Home arrow HTML arrow Page 4 - XHTML Explained
HTML

XHTML Explained


I'm sure you've heard people mumbling about XHTML and how it combines HTML and XML to create the "next generation" of HTML. I too had heard the mumbling, but actually had no idea what XHTML was... up until about 2 months ago. In this article, Mitchell gives us a quick run down of what XHTML is, some of its benefits, how it can be used, and what it looks like. He wraps up the article with a couple of XHTML examples.

Author Info:
By: Mitchell Harper
Rating: 4 stars4 stars4 stars4 stars4 stars / 9
December 29, 2001
TABLE OF CONTENTS:
  1. · XHTML Explained
  2. · XHTML Defined
  3. · XHTML Benefits
  4. · DTD's
  5. · XHTML Examples
  6. · Conclusion

print this article
SEARCH DEVARTICLES

XHTML Explained - DTD's
(Page 4 of 6 )

XHTML documents have three parts: the DOCTYPE (which contains the DTD declaration), the head and the body. To create web pages that properly conform to the XHTML 1.0 standard, each page must include a DTD declaration; either strict, transitional, or frameset. Each of the three DTD’s is described (with an example) below:

Strict

You should use the strict DTD when your XHTML pages will be marked up cleanly, free of presentational clutter. You use the strict DTD together with cascading style sheets, because it doesn’t allow attributes like "bgcolor" to be set for the <body> tag, etc.

The strict DTD looks like this:

<!DOCTYPE html

PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


Transitional

The transitional DTD should be used when you need to take advantage of the presentational features that are available through HTML. You should also use the transitional DTD when you want to support older browsers that don’t have built-in support for cascading style sheets.

The transitional DTD looks like this:

<!DOCTYPE html

PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


Frameset

You should use the frameset DTD when your XHTML page will contain frames. The frameset DTD looks like this:

<!DOCTYPE html

PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">


It should be fairly obvious which DTD declaration to include in your XHTML file simply by just reading the features of each one. Now that we've got all of the formal details of XHTML out of the way, let's look at some examples of XHTML.
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