Web Standards

What are web standards?

My favorite description (succinct though slightly technical) is this :

The term web standards can mean different things to different people. For some, it is 'table-free sites', for others it is 'using valid code'. However, web standards are much broader than that. A site built to web standards should adhere to standards (HTML, XHTML, XML, CSS, XSLT, DOM, MathML, SVG etc) and pursue best practices (valid code, accessible code, semantically correct code, user-friendly URLs etc).

In other words, a site built to web standards should ideally be lean, clean, CSS-based, accessible, usable and search engine friendly.

- Russ Weakley of MaxDesign

Two of the most important elements comprising web standards include separating content from design, and using semantic markup for all content. Taking web standards one step further, behavior can also be separated out.

Separating content from design is achieved by including only meaningful content in the HTML files for your web site, and using CSS (Cascading Style Sheets) to position that web page content. Along these lines, graphic images that are used as part of the design but otherwise aren't meaningful content should be included in the CSS files, not the HTML files. For example, rounded corners are not meaningful content unless your web page is a tutorial about how to create rounded corners. All references to design elements like that should be in the CSS files. A portrait of you on your About Us page is meaningful content and should be included in the HTML file. The HTML file should not include any explicit formatting instructions like <font> tags, inline styles, or anything of the sort. All of that should be in the CSS file.

Semantic markup means using HTML tags to describe the content contained between the tags. By "describe the content" we mean, what is the purpose and/or significance of the content? Is it a heading, and how important is that heading? Is this a paragraph, or a list, or an image? Proper use of tables is the biggest change for most web developers. When implementing web standards, tables are only used to describe tables of data, and not to layout the web page.

Separating behavior means using unobtrusive Javascript and DOM scripting. When this is done, Javascript commands are for the most part not embedded in the HTML page. Instead Javascript functions in a separate file latch onto <hooks> in the HTML page - usually elements, element id's and classes.

So why should this matter to you?

Why web standards matter

There are myriad benefits to using web standards. Here are some highlights:

How are web standards different from older ways to create web sites?

Many web sites have been created using tables to layout the site itself. It is certainly easier and quicker in some cases to do this. Tables have a nice grid structure making it easy to lay out the page in a logical fashion.

Unfortunately, table based layouts are fraught with problems. For one, it is more difficult to update content. With a table, the formatting of the page (the table structure code) is interlaced with the content. One must take care not to break the layout of the page when making content updates. It is a hassle to negotiate all the table code to highlight the content to be updated.

Search engines don't understand your site as well. Search engines expect tables to be used for tabular data. When tables are used otherwise, you impair the ability of search engines to interpret the content of your site and how relevant it is.

Creating alternate layouts of your site means starting over. With tables it is extremely difficult to linearize content, or move a column that was on the left side of the page to the right side of the page.

CodeGeek.net uses web standards

We are firm believers in web standards. If having a site designed in accordance with web standards is important to you, contact CodeGeek.net today.