XHTML Validation: Does Your Blog Comply?

Since there was such interest in XHTML and HTML Validation, I thought I’d share two more aspects of HTML that can affect the validation of your website or blog. Making changes to your site helps you develop the habit of correctly coding your blog posts or web pages. These points are simple, and you can significantly enhance your site’s load time by improving the consistency of your web pages and blog posts.

Using The Right Nesting Twigs

With HTML, tags usually come in pairs. These pairs like to stay together, they like to nest together. It is important to nest your tags correctly because, as with other aspects of your HTML code, the browser expects them to be nested in the right way. Incorrectly nested tags create confusion and slow down the speed a browser can process code and return a web page.

Correct:
<p>This is a paragraph tag. Inside it we could place a correctly nested tag called <strong>strong</strong></p>

Notice in the above code that the strong tag stays together, completely nested within the paragraph tag. It would have been easy to instead write:

Incorrect:
<p>This is a paragraph tag. Inside it we could place an incorrectly nested tag called <strong>strong</p></strong>

The appearance of the text on the screen would have been identical. It would not appear to be an error when someone views the page, however, while most browsers forgive the error and displays the paragraph with a bold word, it stumbled over the incorrect nesting, taking a moment longer to understand the intention of the code.

The importance of nesting is more significant with some tags. The <div> tag, for example, can play an important part in the layout and design of your blog. Incorrectly nesting this tag will cause display errors on the page. Nesting errors in <table> <tr> & <td> tags can also create display issues and serious loading delays.

Please Lower Your Case

When I first learned to write HTML it was taught in uppercase. Tags were in uppercase, attributes in lower case, and there was a kind of ‘prettiness’ about the code. It looked interesting but the case was not significant. XHTML is less forgiving. Lower Case is considered the right case and uppercase tags are not recognized in the same way.

Tommy Olsson covered this question more eloquently than I have just done in his SitePoint article, “Bulletproof HTML: 37 Steps To Perfect Markup“:

Is HTML case-sensitive?

No, but XHTML is. In XHTML, all tags and attributes must be in lowercase. Traditionally, HTML element names and tags were written in uppercase, but with the advent of XHTML, this convention has slowly given way to the XHTML standard of lowercase element names.

<A HREF=""> is not longer the same as <a href="">. The former will return a validation error. While both cases will work correctly in most browsers the lowercase is considered uniform and script is now always taught (or should be) in lower case.

Want To Learn More?

Still not satiated when it comes to hints and tips for having valid XHTML and HTML? Are there other validation errors on your site or blog that you don’t understand? Please, leave a comment! I’d love to help out with any site issues you’re having and will continue to explain XHTML and HTML Validation if you’re interested in learning more.

You can learn more about valid XHTML, HTML, and CSS in the programmers gospel, W3 Schools.

Test the validation of your own blog with W3’s Validation Service.

Hire a Web Tech to bring your site to compliance because honestly, wouldn’t you rather just be writing?

No related posts.

Tweet This! Click here to send this page to Twitter! Stumble this! Subscribe to Writer's Round-About from your RSS Feed Reader! Digg this! Add to del.icio.us! Add to Technorati! Share on Facebook! Seed Newsvine! Reddit!

VistaPrint - Choose from a large selection of branded merchandise, FREE!




7 Comments - Please, share your thoughts! »

  • MicheleTune (Michele L. Tune) tweeted:

    RT: @laffarsmith [shares] New from WRA: http://tinyurl.com/c4znjo (XHTML Validation: A Case For Nesting)

  • Lyndi said:

    If one is not used to validating your code some of those messages received from the validator could seem quite intimidating. Your offer to assist others in this regard is quite unique, not many would be prepared to do this.

    My advice on these issues is to make sure that when you select a theme for your blog, first ensure that it does validate. This gives you a nice platform to start off with. Keeping the validated status as you continue then also becomes a lot easier.

  • Rebecca Laffar-Smith (author) said:

    Great Advice, Lyndi! Starting with a theme that validates is a very good idea. There are some very ‘messy’ themes and cleaning up someone else’s code is often the thing of nightmares.

    I’m glad to offer this kind of help because I know how daunting those error codes can seem. Besides, I’m selfish enough to want the websites and blogs I visit to load faster. ;-)

  • Melissa Donovan said:

    Hey, where’s my comment? I’m pretty sure I left one here and I’ve come back to check on the follow-up. Hmm. Methinks it got eaten by the spam filter.

  • Rebecca Laffar-Smith (author) said:

    Hi Melissa, I’m sorry but there is nothing in the spam filter. I keep a vigorous eye on it so legitimate comments don’t get lost in the shuffle. Perhaps your comment was on the other XHTML Validation post? Or perhaps the space between the web ate it, that sometimes happens unfortunately.

  • Sandy said:

    Hi Rebecca,

    Some kind folks @ WOT (Web of Security) informed me that my blogs have errors and warnings. I didn’t even know they existed because both are up and running, nor did I have a clue about website validators (if I had, I would have followed the advice to check while building my blogs). Unfortunately, I don’t have a clue as to how to go about fixing them and am terrified of severely messing up my blogs or losing them altogether. I’m in severe need of help. Could you please email me as to your price for fixing them?

    Thank you so much ~ Sandra Winn

    http://momsfightingfat.com and http://sandrawinn.net
    Sandy shares: Jordan Peele as Barack Obama in Funny or Die Skit

  • Rebecca Laffar-Smith (author) said:

    Thanks for your comment, Sandy. It’s great to be able to discuss your own situation more via email. :-)
    Rebecca Laffar-Smith shares: Book Review: Fearless Confessions by Sue William Silverman

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.

CommentLuv Enabled