Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Why won't the CSS apply to this code?

HTML: <!DOCTYPE html> <link rel="stylesheet" type="text/css" href="css/style.css"> <link href="https://fonts.googleapis.com/css?family=Barlow+Condensed:100|Indie+Flower|Press+Start+2P|Sigmar+One|Tangerine" rel="stylesheet"> <head> <title>Lowering Taxes</title> </head> <body> <h1 class="bold">Lowering Taxes</h1> </body>

CSS: .bold{ font-family:"Sigmar One"; }

1 Answer

Hi Jack!

There are multiple things to check:

  1. Check whether your css file is saved as style.css like you said in html.
  2. Check whether you have saved your recent unsaved work.
  3. Check if your file is in the css folder like you said in html.

I did find something that may be the answer, you did not put your link in the <head> </head> tags. Also wrap all of your html code in <html></html> tags.

Currently:

<!DOCTYPE html>
<link rel="stylesheet" type="text/css" href="css/style.css"> 
<link href="https://fonts.googleapis.com/cssfamily=Barlow+Condensed:100|Indie+Flower|Press+Start+2P|Sigmar+One|Tangerine" rel="stylesheet"> 
<head>
    <title>Lowering Taxes</title> 
</head> 
<body> 
    <h1 class="bold">Lowering Taxes</h1> 
</body>

How it should look:

<!DOCTYPE html>
<html>
    <head>
        <link rel="stylesheet" type="text/css" href="css/style.css"> 
        <link href="https://fonts.googleapis.com/cssfamily=Barlow+Condensed:100|Indie+Flower|Press+Start+2P|Sigmar+One|Tangerine" rel="stylesheet"> 

        <title>Lowering Taxes</title> 
    </head> 
    <body> 
        <h1 class="bold">Lowering Taxes</h1> 
    </body>
</html>

I hope this helps!

Thanks!!! :)