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

Stuck on Add "css/normalize.css" to the page as an external stylesheet.

This is my code, i can't get past the question :(

'''html <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Smells Like Bakin' Cupcake Company</title> </head>

<body> <div id="featured-cupcake"> <h2>Cupcake of the Week</h2> <img src="img/featured-cupcake.jpg"> </div> </body> </html> '''

4 Answers

To add an external stylesheet you would add code similar to:

<link href="css/normalize.css" type="text/css">

That code would be inserted between the <head> and </head> tags.

I think you also need to add the attribute "rel" with the value of "stylesheet".

<link rel="stylesheet" href="css/normalize.css" type="text/css" media="screen">

How to add normalize.css:

  1. Go to normalize.css file from github
  2. Click the big green download button
  3. Save the file to your desktop
  4. Move the normalize.css file in your sublime text project folder
  5. Create a link element that references normalize.css

This works the same way as an <a> by using the href attribture. Make sure to use the right path for the normalize.css file here as well.


If you are still having issues it's most likely related to file paths, that's one of the most common issues for those new to web design. The key is to put your files in the correct folder relative, to your HTML file. You can read up about absolute vs relative paths

Thank you for all the help, this was the answer : <link rel="stylesheet" href="css/normalize.css" type="text/css" media="screen">