user3127783
user3127783

Reputation: 3

Cannot get CSS to apply to HTML file

<!DOCTYPE html>
<html>
  <head>
    <meta charset=“UTF-8” />
    <title>Footer Design</title>
    <link rel=“stylesheet” type=“text/css” href=“style.css” />
  </head>

  <body>
    <div id=“footer”>
      <div id=“footer-col-one”>
        <h3>Categories</h3>
        <ul>
          <li>Snow</li>
          <li>Surf</li>
          <li>Travel</li>
        </ul>
      </div>

      <div id=“footer-col-two”>
        <h3>Navigation</h3>
        <ul>
          <li>Home</li>
          <li>About</li>
        </ul>
      </div>

      <div id=“footer-col-three”>
        <h3>Follow Me</h3>
        <ul>
          <li>Facebook</li>
          <li>Twitter</li>
          <li>Instagram</li>
        </ul>
      </div>
    </div>
  </body>
</html>

For some reason I cannot get my CSS stylesheet to apply. It's not the same directory as this html file. I'm using TextEdit and set it up for use with html & css. I did notice that any where I had double quotes I'm getting some weird output on Chrome Developer Tools like the following:

<link rel=“stylesheet†type=“text/css†href=“style.css†/>

Upvotes: 0

Views: 169

Answers (2)

Asraful Haque
Asraful Haque

Reputation: 1125

Please use this source formatting .Do not use “ . Use " . If your style.css file is in the other location means suppose that style.css is in the css folder so give the path like href="css/style.css"

Hope the answer and use this below html code which I have modified!

Footer Design

<body>
<div id="footer">
  <div id="footer-col-one">
    <h3>Categories</h3>
    <ul>
      <li>Snow</li>
      <li>Surf</li>
      <li>Travel</li>
    </ul>
  </div>
  <div id="footer-col-two">
    <h3>Navigation</h3>
    <ul>
      <li>Home</li>
      <li>About</li>
    </ul>
  </div>
  <div id="footer-col-three">
    <h3>Follow Me</h3>
    <ul>
      <li>Facebook</li>
      <li>Twitter</li>
      <li>Instagram</li>
    </ul>
  </div>
</div>
</body>
</html>

Upvotes: 0

Quentin
Quentin

Reputation: 943157

You can't delimit HTML attribute values with characters, you must use " or '.

zoomed in screenshot of the above text

Left/Right quotes will be treated as part of the value (and thus the URL) and not as HTML special characters.

Your problem is most likely caused by writing code using a Word Processor with Smart Quotes turned on. Use a text editor (I'm fond of Sublime Edit 2 myself, but there are many other excellent choices such as Komodo Edit and Brackets).

This would have been picked up (albeit not explicitly) had you used a validator.

Upvotes: 5

Related Questions