【发布时间】:2016-07-15 15:40:42
【问题描述】:
问题:样式表没有在页面上显示样式。
已检查:它已正确链接,甚至在检查页面时显示在源下,我已尝试清除缓存以确保不是那样。
代码:
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../style/reglog_style.css">
<link rel="stylesheet" type="text/css" href="http://t-off.tk/style/style.css">
<title>Register</title>
</head>
<body cz-shortcut-listen="true">
<h1>This is the webpage header</h1>
<h2>This is the page content</h2>
<h1> This is the footer at the bottom of the page, it is under construction </h1>
</body>
</html>
样式表:
style.css:
<style>
body {
background: #2d343d;
}
</style>
reglog_style.css:
<style>
body {
background: #2d343d;
}
</style>
任何关于正在发生的事情的想法将不胜感激,我在这里不知所措。 谢谢!
【问题讨论】:
-
不要将
<style>放在 CSS 文件中。只是样式。 -
同意@SamiKuhmonen +1。另请注意,只有您的 style.css 主体类会显示,因为它将覆盖 reglog_style.css 表中的类 - 加载 css 样式表时,顺序很重要。
-
@HunterTurner 不,Apache2 日志中没有任何错误的迹象
-
@SamiKuhmonen 是的,就是这样,把所有东西都扔掉似乎是一件很奇怪的事情。谢谢!
-
嗯,这是解析错误,所以很容易破坏一切,一点也不奇怪