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

Miriam Allman
PLUS
Miriam Allman
Courses Plus Student 1,761 Points

My CSS file is not being applied to my Lake Tahoe page

My HTML file and my CSS file are in the same file folder, style.css yet the universal selector is not applying the css to my Lake Tahoe page

Steven Parker
Steven Parker
229,732 Points

To facilitate analysis, please make a snapshot of your workspace and post the link to it here.

3 Answers

Steven Parker
Steven Parker
229,732 Points

A snapshot is a much better way to share both your code and your environment.

But if you prefer to post code directly, always use the instructions for code formatting in the Markdown Cheatsheet pop-up below the "Add an Answer" area. :arrow_heading_down:   Or watch this video on code formatting.

But I think I see your issue anyway, You said your HTML file and your CSS file are in the same file folder, but the code that loads the CSS file is looking for it to be in a separate folder named "css":

<link rel="stylesheet" href="css/style.css">

So you can fix it by changing that line so the href property is set to just "style.css", or you could create a folder named "css" and move that file into it.

Miriam Allman
PLUS
Miriam Allman
Courses Plus Student 1,761 Points

Here is my html file

<html> <head> <title>Lake Tahoe</title> <link rel="stylesheet" href="css/style.css"> </head> <body> <header> <span> Journey through the Sierra Nevada Mountains</span> <h1> Lake Tahoe, California</h1> </header><div>

      <p>
          Lake  Tahoe is one of the most breathtaking attractions located in California. It's home to a number of ski rsorts, summer outdoor recreation, and tourist attractions. Snow and skiing are a significant part of the area's reputation.
    </p>
    <a href="#"> Find out more</a>
    <h2>Check out all the Wildlife</h2>
    <p>
        As spawning season approached the fish acquire a humpback and protuberant jaw.After spawning they die and their carcasses provide a feast for gatherings of mink, bears, and Bald eagles.
    </p>
    <a href="#"> See the Wildlife</a>
    <h3>From Tents to Resorts</h3>
    <p>
        Lake Tahoe is full of wonderful places to stay. You have the ability to sleep in the outdoors in a tent, or relax like a king at a five star resort. Here are our top three resorts:
        <li>Lake Tahoe resort Hotel</li>
        <li>South Lake Tahoe Resorts</li>
        <li>Tahoe Ski Resort Lodging</li>

    </p>
    <h3>Pack Accordingly</h3>
    <p>
    One of most important things when it comes to traveling through the great outdoors is packing accordingly. Here are a few tips: 

<ol>
    Bring layers of clothing
    Pack sunscreen
    Carry extra water just in case
    Pack light  
</ol>
  </p>

</body> </html>

Here is my CSS file

  • { margin: 0;
    padding: 0; color: red; }
Miriam Allman
PLUS
Miriam Allman
Courses Plus Student 1,761 Points

Thanks Steven, I tried using a snapshot - didn't work -maybe because I am using a mac - I ended up creating a folder named "css" and moved the file into it