Home arrow HTML arrow Page 3 - W3C Web Standards
HTML

W3C Web Standards


The days of “this site is best viewed in...” are over! We shall no longer be discriminated against for using the browser of our choice. Forget tedious template management, and be prepared to save some dollars on bandwidth! The World Wide Web Consortium have come to agreement on the new Web Standards that will allow us to code and maintain our pages with far less effort, all the while resting assured that everyone can see them as we intended.

Author Info:
By: Justin Cook
Rating: 4 stars4 stars4 stars4 stars4 stars / 41
April 12, 2004
TABLE OF CONTENTS:
  1. · W3C Web Standards
  2. · An Eagle's-Eye View
  3. · First Component: XHTML
  4. · Attributes
  5. · Second Component: CSS2
  6. · Code Explanation
  7. · Third Component: ECMAScript

print this article
SEARCH DEVARTICLES

W3C Web Standards - First Component: XHTML
(Page 3 of 7 )

XHTML, for those of you who don't already know, is simply an amalgamation of XML and HTML, no surprises there. Chances are that you're well versed in HTML, so don't bother rushing out to by a book on XHTML. There are just a few simple rules that we must now comply with. If we do this successfully, we open up so many exciting opportunities for our document! I mean, think about it, our document will actually become well-formed XML. We could interact with so many applications and scripts and applets and and and... Alright, it's not as exciting as I made it sound, but it's darn handy.

Rule Numero Uno: Well-formedness

This primarily means that all elements are properly closed, as well as nested properly. Let me explain these both clearly, as well as the further aspects of XHTML.

Nesting

Many times in HTML we could get away with overlapping elements.


<p>This is <strong>overlapped (tsk tsk).</p></strong>

That is morally wrong, unethical, just plain bad. It should be:


<p>This is <strong>nested (beautiful).</strong></p>

Don't try to get away with overlapping anymore, it just won't be tolerated. Consider yourself forewarned!

I Need Closure on that Anecdote!

Remember those days when it was getting near quitting time, and you were getting lazy?


<p>You know what I mean<p>Don't you?!<p>Ahh, the lazy coder style...

Give yourself a slap on the wrist! We must shape up, as XML does not permit the omission of closing tags.


<p>Let's try this again.</p><p>Ahh, much better</p>

'But' you challenge, 'how do you plan to handle empty tags like <br>s and <hr>s?' First of all I commend you for asking, and I assure you, the answer is simple. Take a look:


<hr />
<img src=/images/logo.jpg” /><br />

There, that's it! That simple little slash at the end terminates the element, and our parser is happy.


blog comments powered by Disqus
HTML ARTICLES

- Does HTML5 Need a Main Element?
- Revisiting the HTML5 vs. Native Debate
- HTML5: Not for Phone Apps?
- HTML5 or Native?
- Job Hunting? Freelancer.com Lists This Quart...
- HTML5 in the News
- Report: HTML5 Mobile Performance Lags
- The Top HTML5 Audio Players
- Top HTML5 Video Tutorials
- HTML5: Reasons to Learn and Use It
- More of the Top Tutorials for HTML5 Forms
- MobileAppWizard Releases HTML5 App Builder
- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials