
Now that we’ve covered the basics of XHTML, we’re going to wrap it up with this post. We’ll be coming back to XHTML throughout the series when necessary. So, let’s take a look at our original XHTML document from back in the original post:
[code='xml']
Hello world!
[/code]
Since then, we’ve learned how to add links and images and various tags you can add to your document’s head. Now, before we add all that to our document, I want to go over two more tags.
Header Tags
No, this is not related to the head of your document, this is to do with section headings. These are mostly useful for SEO purposes, but also provides different formatting for better visual separation of sections. The tags for these are h1, h2, h3, h4, h5 and h6. You do not need to use all of these, but they should be used in order, without skipping any.
[code='xml']
Header Tags Example
Section text...
Sub-section
Sub-section text
[/code]
The Div Tag
The div tag will be one of the tags you use the most while coding webpage designs. The div tag is used to separate and group elements on your page for similar formatting or positioning. You will find this tag very useful when used with CSS. It is worth noting that div tags are almost always used with the attributes id or class.
[code='xml']
Tags can be grouped in divs.
And even divs can be nested within divs.
[/code]
Combining it All
Now, let’s combine some of what you’ve learnt into a document:
[code='xml']
Advanced XHTML Document
This is an example of an XHTML Document.
This example was provided by BlueFur.com.
[/code]
Additional Resources
I’m hoping I’ve set you on the right path to becoming proficient in coding XHTML. I obviously can’t go over everything, but I believe I have gone over what’s necessary to get you started. Sometimes it is best to go out on your own and self-teach yourself more in-depth on this kind-of stuff, that’s what I did. So here’s some helpful resources to help you further master XHTML:
XHTML Markup Validator – Having valid XHTML markup is important to ensure the greatest compatibility among all browsers. This free service will validate your documents for you.
W3Schools – A concise XHTML reference, great for when you need to look something up real quick.
SitePoint HTML Reference – If you’re interested in a great, technical HTML reference, then this will be for you.





Atniz
January 20, 2009 7:39 am
Good basics that have been shared here about xhtml. Now I know something more details when I view the source file in firefox for certain websites.
Funny Stuff
January 20, 2009 6:20 pm
Using header tags is important but I have a question. How many of each header tag should be used at most on each page if you use them?
Matt Freedman
January 21, 2009 4:53 pm
Most header tags can be used more than once. For meta and link the values of name and rel (respectively) should be different. However, style and script tags can be used as many times as necessary. The title tag may only be used once.
Matt, Around the Web « Matt's Blog
January 22, 2009 11:41 pm
[...] Web Dev: Putting it all Together Everything PHP: Echo versus Return WordPress Development: Filters Moving Beyond SSH: Installing a Web Server [...]