Bali Web Design Services
.com
.net
.org
.biz
.asia
.mobi
.info
.name
.us
   
Cpanel WHM Demo
   
Live Help
April
20
2010
Understanding of the Doctype Declaration

Your web pages appear correctly and consistently in web browsers when you tell a web browser which version of HTML or XHTML you’re using by including what’s called a doctype declaration at the beginning of a web page. This doctype declaration is the first line in the HTML file, and not only defines what version of HTML you’re using (such as HTML 4.01 Transitional) but also points to the appropriate DTD file on the Web.

The most popular versions of HTML and XHTML these days are HTML 4.01 Transitional and XHTML 1.0 Transitional. These types of HTML still let you use presentational tags like the <font> tag, thereby providing a transition from older HTML to the newer, stricter types of HTML and XHTML. Although it’s best not to use these tags at all, they still work in the Transitional versions, so you can phase out these older tags at your own pace. In the strict versions of HTML and XHTML, some older tags don’t work at all.

If you’re using HTML 4.01 Transitional, type the following doctype declaration at the very beginning of every page you create:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.
w3.org/TR/html4/loose.dtd">


The doctype declaration for XHTML 1.0 Transitional is similar, but it points to a different DTD. It’s also necessary to add a little code to the opening <html> tag that’s used to identify the file’s XML type—in this case, it’s XHTML—like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">


 
#fc3424 #5835a1 #1975f2 #b487c5 #af8cb4 #3ac3c6