internet.com
You are in the: Small Business Computing Channelarrow
Small Business Technology
» ECommerce-Guide | Small Business Computing | Webopedia | WinPlanet

WinPlanet Software Downloads and Reviews for Small Businesses
Search
Power Search | Tips
-
Navigate WinPlanet
WinPlanet Home Page

Software
Download Index
In-Depth Reviews
Tips & Tutorials
Updates
News

Software Categories
Browsers
Chat / Conferencing
Desktop Utilities
Development
Internet Apps
Multimedia
OS Service Packs
Productivity Tools

Software Glossary

WinPlanet Newsletter

internet.commerce
Partners & Affiliates













Small Business Computing
Small Business Computing
Ecommerce Guide
Webopedia
WinPlanet

WinPlanet / Tips & Tutorials

Download of the day
7-Zip

Most Popular Software Downloads
Mozilla Firefox
Microsoft Office 2010
QuickTime for Windows
Adobe Reader
Mozilla Thunderbird
Winamp
Microsoft Office 2007 Service Pack
Google Earth
Adobe Flash Player
Windows Vista Service Pack 2 (Vista SP2)
CCleaner (Crap Cleaner)

Most Popular Software Articles
Windows Vista Tips: Home Networking Setup Tutorial
10 Must-Have Apps: The Free Windows Networking Toolkit
How to Make Your Internet Connection Faster, Better


Software Reviews

Dev Tutorial: Behind the Scenes with XHTML
Document Type Definition
Lee Underwood

Document Type Definition

If the XML declaration isn't used, the first line in the document must be the Document Type Definition (DTD), or DOCTYPE. This statement is used to "set out the rules and regulations for using HTML in a succinct and definitive manner" (W3C). Failure to use a full DTD could send your visitor's browser into 'quirks' mode, causing it to behave like a version 4 browser (interestingly, a large number of Web pages do not use the doctype statement; many of them are Web development sites). There are three doctypes available for XHTML: strict, transitional, and frameset. Be careful as these declarations are case-sensitive.

The strict DTD is used for documents containing only clean, pure structural mark-up. In these documents, all the mark-up associated with the layout comes from Cascading Style Sheets (CSS).

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

The transitional DTD is used when your visitors may have older browsers that can't understand CSS too well. You can use many of HTML's presentational features with this DTD.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Finally, use the frameset DTD when you want to use HTML to partition the browser window into two or more frames.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

The DTD files referenced above are plain text files. You can enter the URL and download them. There is nothing earth-shattering in the files but you'll be able to see what the browser is reading.

The XML Namespace

The next line in our document is the XML namespace. This statement identifies the primary namespace used throughout the document. An XML namespace "is a collection of names, identified by a URI reference, which are used in XML documents as element types and attribute names" (W3C). The html tag is included at the beginning, effectively combining the two tags. In addition, the language attribute is also included, in both XML (xml:lang="en") and HTML (lang="en") terms.

The Wrap-Up

The rest of the header shown is basic HTML code. The head tag opens the header and must be closed before the body tag. The title tag follows the opening header tag. Next, the meta tags and the link to the style sheet, if necessary, are included. Be sure to close the meta and style sheet link tags with " />". Remember, in XHTML, all tags and attributes must be lower case and all tags, except the DOCTYPE, must be closed.

The article "XHTML 1.0: Where XML and HTML meet" provides a further, in-depth study of transitioning to XHTML.

Helpful Links

Tutorial adapted from WebReference

« Previous Page

Contents:
1. Behind the Scenes with XHTML
2. Document Type Definition





The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers