【问题标题】:CSS Stylesheet Not LinkingCSS 样式表未链接
【发布时间】: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>

任何关于正在发生的事情的想法将不胜感激,我在这里不知所措。 谢谢!

【问题讨论】:

  • 不要将&lt;style&gt; 放在 CSS 文件中。只是样式。
  • 同意@SamiKuhmonen +1。另请注意,只有您的 style.css 主体类会显示,因为它将覆盖 reglog_style.css 表中的类 - 加载 css 样式表时,顺序很重要。
  • @HunterTurner 不,Apache2 日志中没有任何错误的迹象
  • @SamiKuhmonen 是的,就是这样,把所有东西都扔掉似乎是一件很奇怪的事情。谢谢!
  • 嗯,这是解析错误,所以很容易破坏一切,一点也不奇怪

标签: html css


【解决方案1】:

正如@SamiKuhonen 回答的那样,我不得不删除

&lt;style&gt;&lt;/style&gt;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-01-13
    • 2017-02-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多