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

Can anyone tell me why my css rule is not being applied?

Here is the html

<!DOCTYPE html> <html> <head> <title>Lake Tahoe</title> <link rel="stylesheet" href="css/style.css"> </head> <body> <header id="top" class="main-header"> <span class="title">Journey Through the Sierra Nevada Mountains</span> <h1>Lake Tahoe, California</h1> <img class="arrow" src="img/arrow.svg" alt="Down arrow"> </header>

And here is the rule not taking affect.

.title { color:#fff; font-size: 1.625rem; letter-spacing: .065em; }

Can anyone see what I am missing? the text is staying the colour assigned in the body rule and not taking on the white from the class selector.

Thanks in advance!

4 Answers

title is not a class. Remove the 'period' before title in your css. Your css should be:

title { color:#fff; font-size: 1.625rem; letter-spacing: .065em; } not .title { color:#fff; font-size: 1.625rem; letter-spacing: .065em; }

I believe that should do it.

ayezee33
ayezee33
16,096 Points

Is the font changing size? Try inspecting element and see if your stylesheet is being imported. Here are a few things to check

1) Spelling of your css file name 2) Is the file in the directory you are calling it from? (CSS folder) 3) Is that the only thing in your CSS? Make sure your classes are ended correctly

Thanks for the reply. no it is not the only css on the sheet but seems to be the only part not taking affect. I will go over it again as double check everything is ended right.

Thanks Neil I will give that a try. Figured it had to be something I was missing. Cheers Danni