|
Separation of Structure & Presentation |
|
|
|
When discussing web standards, something that is mentioned a lot is the importance of separating structure from presentation. Understanding the difference between structure and presentation can be difficult at first, especially if you're used to not thinking about the semantic structure of a document. However, it's very important to understand this, since controlling the presentation of a document with CSS becomes much easier if structure and presentation are separated.
- Structure consists of the mandatory parts of a document, plus the semantic and structured markup of a document's contents.
- Presentation is the style you give the content. In most cases, presentation is about the way a document looks, but it can also affect how a document sounds because not everybody uses a graphical web browser.
Separate structure from presentation as much as possible. Ideally, you should have an HTML document which contains the structure and content, and control the presentation of the document entirely with CSS.
Separation of structure from presentation is not very common on the Web today. On most websites the HTML code lacks both structure and semantics.
|