KuraFire Network


Latest addition: Jan 19, 2007: Times are changing

Log

XHTML Q&A: switching to XHTML

· By Faruk Ateş on Mar 30, 2005 · 0 comments ·

Subject level: Intermediate

The first of a series of Questions and Answers on XHTML and semantics, on reasons for switching (or not), and on what it takes to switch. Today's question is: How important is it to adjust old pages, or pages you're currently working on, to the new XHTML-way?

One of the results of my Case for XHTML article has been that people started asking me a lot of questions about XHTML. I promised them that I would write a post about it, covering all their questions. I'm a little late in actually doing this, but at least I finally got around to it. However, for the sake of keeping things manageable, I will cover all questions in separate Log posts. For one, it would take me too long to do them all at once, and also, it would be a really big post, otherwise.

How important is it to adjust old pages, or pages you're currently working on, to the new XHTML-way?

It's not of vital importance that you convert all your old webpages, or all your current working documents, to XHTML. However, it is important to stay up to date with the goings on of the modern Internet, and right now, switching to XHTML is probably the easiest, if not the best way to do this.

For over three years now, web standards have become more and more important. At first, most people saw XHTML as the way to make proper, standards-compliant websites (for a change). Eventually, people have been coming round on that and realizing that the most important thing to keep in mind was semantics, rather than the choice of XHTML or HTML. Semantic purity is what it's all about, and both XHTML and HTML are merely the path towards it.

Nevertheless, XHTML has proven to be an excellent medium to get people informed about semantics. Especially when you pair it up with CSS, you get a true powerhouse for the case for web standards and semantics that amazes and impresses webdevelopers around the globe.

Whether you change your old and current webpages to valid XHTML or not, is not as important as whether you convert your markup to be semantically meaningful. This can be summed up with these ground rules, for which I will be writing a more comprehensive article very soon:

  • Use header elements for headings (<h1> through <h6>, instead of something like <font size="7" color="red">)
  • Use appropriate lists for content that is a list (rather than using "* foo
    * bar
    " or, worse, a table)
  • Get rid of all presentational markup (<b>, <i>, <font>, etc.)
  • Use CSS to manage your site design as much as possible, rather than relying on tables
  • If you're unsure as to what element you should use, always ask yourself the purpose and meaning of what you're adding

The last few years, many excellent articles and tutorials have been made to help you understand all about semantics, how to write semantic pages and why it matters. Keep in mind, though, that a lot of excellent material has been written in the time that most people still thought that it was XHTML that mattered, meaning that if you google for articles, tutorials, tips and tricks, you're better off using XHTML as a search word instead of HTML. Many of the up-to-date documents that you can find in Google these days are talking about XHTML more than semantics. Searching for HTML tutorials gives you many outdated pages that should not be used!

Getting back to the question, it's all about learning how to write semantic pages and why you should do just that. Molly Holzschlag's article on Informit, Integrated Web Design: The Meaning of Semantics, is a good start. Beyond that, there is of course a vast resource you can get to through Google, or you can just wait until I finish my own article.

Edit: Kevin Marks pointed me to two excellent presentations: Semantic XHTML: Can your website be your API? - Using semantic XHTML to show what you mean and The Elements of Meaningful XHTML. Both are great to read at this point. Thanks, Kevin!

Next post will cover the actual writing of XHTML; the lowercase issue, the changing from <i> to <em>, and so forth.

If you have any questions regarding XHTML, semantics or this post itself, you can always contact me.

Bookmark: Newsvine del.icio.us Digg

All times are in CET. It is now 19:46.