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 CSS: Cascading Style Sheets Use ID Selectors

Jenni Jung
Jenni Jung
1,203 Points

is there a particular reason why the CSS code is within the <head> element of our html doc?

When incorporating CSS into our html file, is there a particular reason why the CSS code is within the <head> element of our html doc?

Also, will all/most CSS rules have to be within the <style> element? and will <style> be used mostly within the <head> element?

Jenni Jung
Jenni Jung
1,203 Points

sorry i retract my question, it was premature. i'll figure out how to delete and take it off air

Jenni Jung
Jenni Jung
1,203 Points

sorry i retract my question, it was premature. i'll figure out how to delete and take it off air

1 Answer

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,252 Points

Hi Jenni,

You're right in thinking that it's best to put yur CSS in an external file. But in some cases where you have mimimal amounts of CSS code it migbt be appropriate to put your code in the head of your HTML document. Where you put your CSS code though is up to you :)