Separation Of Layers: Content, Presentation, And Behavior

Content
Substantive information or creative material viewed in contrast to its actual or potential manner of presentation.
Presentation
A visual representation of something.
Behavior
The action or reaction of something under specified circumstances.

These are just a few crappy definitions I pulled from some online dictionaries that suit my purpose, but know them well. If there is any one thing I could hope to impart, it would be the ability to recognize these three facets of website implementation. I cannot stress enough how much a site’s content, presentation, and behavior need to remain separate.

We will get into exactly how to use these things in greater detail later, but for now we’ll look at the basic dos and don’ts.

Content (HTML)

The content of our pages, all of the text, forms, links, and certain images will be represented in markup. For the most part, it is easy to keep the content in the HTML. Where amateur web producers start to fuck things up is using HTML for something other than the content. This is called presentational markup and it was invented by the devil. What we’re looking for is semantic markup, that is, markup which carries a specific meaning within the content. Here are some common HTML elements and attributes that shouldn’t appear in your markup:

It should also be noted that <table> and related elements, as well as <frameset> and related elements should not be used to achieve page layout, but this is enough of a problem that we will address it in greater depth later when we discuss CSS layouts.

Presentation (CSS)

I’m not going to lie. Getting comfortable with CSS takes practice. There are only so many things that can be said in the beginning without diving in and learning the intricacies the hard way:

Behavior (JavaScript)

When you’re starting out, this is of little to no importance. We’ll also be discussing this in great detail, so suffice it to say for now, if there is some user interaction involving elements being hidden, moving, dragging, etc. it will nine times out of ten be a product of JavaScript (assuming we aren’t dealing with Flash).

I imagine this post will become more useful once you start building something. Every so often take a step back and refer to it just to make sure you’re keeping with the basic principle of separation.

Comments

None.

Title & Summary

About

Title & Summary is the personal blog of Caleb Troughton. That’s me. I'm a web developer by day, web developer by night, and raging but amicable alcoholic by weekend. This is where I talk about what I do.

Links

Contact

Subscribe