Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.