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

Basic question: part of CSS with not working with Sublime 3

Hello, Quick question on a simple topic (adding CSS to a page) that I've been working on for the last 10 minutes:

Can anyone figure out why my index doesn't change to steel blue or have a dotted line after "sit amet" when I apply the css?

cheers in advance, Marcel

my html (up until </head>):

<!DOCTYPE html>
<html>
<head>
<title>Adding CSS</title>
<link rel="stylesheet" href="adding-css/start/css/styles.css">
<style type="text/css">
    h1{
        color: white;
        background-color: #E14607;
    }
</style>
</head>

My CSS:

h2 {
color: steelblue;
padding-bottom: 10px;
border-bottom: 2px dotted;
}

ul {
color: white;
background-color: steelblue;    
}

3 Answers

Guil Hernandez
STAFF
Guil Hernandez
Treehouse Teacher

Hi Marcel Gremaud,

I think it's how you're linking the CSS file. I noticed you're linking it as <link rel="stylesheet" href="adding-css/start/css/styles.css">.

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

Hi Guil,

Thanks for your timely reply; however, it still doesn't work. I started using your zip files and then ended up just making my own file for the css. however it does seem to resemble yours to a T. I'm new to this and not perfect with file paths but it should work... I'll just move on with the lesson and see what happens

Guil Hernandez
Guil Hernandez
Treehouse Teacher

Marcel Gremaud,

According to your path href="adding-css/start/css/styles.css", in order for the CSS file to link correctly, your file structure needs to look like this:

Alt text

As you can see, you're linking to the style sheet 3 directories deep into the main project folder. So like we did in the video, it's better if our path is <link rel="stylesheet" href="css/styles.css">, then our file structure should look like:

Alt text

Do you have your css linked in the head tag of your html?

It is exactly as you show Guile (I have the screen shot but don't know how to post on this forum)

C'est mystique

Guil Hernandez
Guil Hernandez
Treehouse Teacher

Marcel Gremaud,

To display a screenshot, you'll need to upload your image somewhere–––maybe use dropbox or imgur.com, then post it using the following markdown:

![alt text](/path/to/img.jpg "Title")