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 How to Make a Website Beginning HTML and CSS Write a CSS Selector and Property

Andy Cooper
Andy Cooper
231 Points

add style.css

How do i add a style.css sheet to the test?

index.html
<body>
    <h1><style>Andy Cooper</style></h1>
</body>

2 Answers

Sean T. Unwin
Sean T. Unwin
28,690 Points

For the Challenge you only have to add style tags above the h1, not include a stylesheet.

If you're unsure how to do that I suggest watching the previous video again - https://teamtreehouse.com/library/how-to-make-a-website/beginning-html-and-css/add-style-to-the-page

Andy Cooper
Andy Cooper
231 Points

Thanks, I worked it out.

Out of interest, why would you use this type of styling method as opposed to setting up a seperate stylesheet?

Sean T. Unwin
Sean T. Unwin
28,690 Points

This is what is called, 'Inline Styling', and it typically has precedence over external stylesheets. It is from the principles of Specificity [1][2] and the Cascade [3][4]. You can find out more here on Treehouse in the Fundamental Concepts section of the CSS Basics course.

References:

  1. https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity
  2. http://www.sitepoint.com/web-foundations/specificity/
  3. https://developer.mozilla.org/en-US/docs/Web/CSS/Cascade
  4. http://www.sitepoint.com/web-foundations/cascade/