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 Creating HTML Content Review: Creating HTML Content

What is the main benefit of including CSS in an external file? - end of lesson quiz

What is the main benefit of including CSS in an external file? - end of lesson quiz

The answer that is correct is:

"Structure and content are separated"

How can this be true, when they are both within the same file - the HTML file.

I would have said that the structure of content and the presentation of content are separated.

  • HTML (Structure of content).
  • CSS (Presentation of content).
  • Javascript (Behaviour of content).

3 Answers

I haven't heard of css being referred to as structure.

I wonder if it was supposed to say "style and content are separated"?

Tom,

The way I see it is that the content is your text, images, video & media etc. The structure is how the text is semantically marked up using HTML. Your CSS file changes how your content is presented.

Take a look at this CSS site that has been around for many years, it is a bit outdated now, as this was before HTML5 and CSS3.

http://www.mezzoblue.com/zengarden/alldesigns/

All the designs share exactly the same HTML file, but they all use different css, so that they are presented differently.

Therefore your content and your structure of your document would both be contained in your pagename.html file.

I think you might have read it wrong?

The HTML file (index.html) is your content, all your text and so on. The CSS File (main.css) is your structure.