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

HTML How to Make a Website CSS: Cascading Style Sheets Use ID Selectors

Christina Dine
Christina Dine
474 Points

Connecting CSS to Html

So it seems that others are having the same issues and I am. I cannot connect mt css to my html. my code is exactly like theirs. I've even tried saving everything and setting it up in Brackets instead. The same thing continues to happen. I'm so confused. :-\

3 Answers

Quang Nguyen
Quang Nguyen
2,235 Points

Hey Christina,

Within your HTML file, locate the section within the head tag.

You type this set of codes into the <head> tag section in order to link your HTML file with your CSS stylesheet:

<!DOCTYPE html>
<html>
  <head>
    <link rel="stylesheet" type="text/css" href="your css stylesheet's file directory goes in here">
  </head>
</html>

I hope this will help you accurately address the issue. Cheer!

First, make sure that your linked your main.css file AFTER the normalize.css file. If they aren't ordered correctly then normalize.css can override main.css. If your code is exactly like theirs, check to make sure that the name of your CSS file is the same as the path you provided in the href attribute, and that the file is located in the CSS folder.