Home > Computers & Technology > Internet > Web Design
Created on: March 14, 2009 Last Updated: March 29, 2009
HTML (Hyper Text Markup Language) is rapidly being replaced by XHTML(Extensible Hyper Text Markup Language). The differences are quiet few,but the results of switching from HTML to XTML is worth the effort. The benefit of XHTML is that it is widely accepted in 'non-computer' devices like cellphones and scaled down browsers. This is known as portability of devices. XHTML is said to be Extensible, which is fancy way of saying the new tags can be added without a new document type declaration. Tags used in XHTML are strict in behaviour. So before using XHTML a person should be familiar with HTML and its tags completely.
Key differences between HTML & XHTML :
1)The tags in the page MUST be in lowercase so instead of <HTML><BODY> , as we would use in HTML, we use instead <html><body>.
2)All the tags which are opened should be closed (<p> </p>). In HTML,many of these tags were simply left open.
3)All tags must be nested properly,so if you start tag 'a' and then start tag 'b' then you must first close tag 'b' before you close tag 'a'.
4)All the attributes must also be in lowercase.
5)All the values of attributes must be enclosed in single or double quotes.
6)Structure must be seperated from content. For example,the <p> tag is content tag (paragraph), so you can't put a table in it, because a table is a format construct. You can however put <p> tag inside <td></td> tags with no problem, because the content goes with construct, not the other way around.
7)Some tags which were previously allowed are no longer allowed,see the discussion below of DTD ( Document Type Declaration ).
The first thing you will notice if you look at sourse of XHTML is the first line is DTD ( Document Type Declaration ) also called as DOCTYPE. There are three DTD's that are used, strict (that will only validate if you have no deprecaed tags), transitional (which will still validate with deprecated tags) and frameset (which is for the page which has frames). Although all tags in XHTML are in lowercase, DTD must be declared in uppercase. The three DTD's look as given below:
1) Strict :
<!DOCTYPE html PUBLIC "-//W4//DTD XHTML 1.0 Strict//EN" "DTD/strict.dtd">
2)Transitional :
<!DOCTYPE html PUBLIC "-//W4//DTD XHTML 1.0 Transitional//EN" "/DTD/transitional.dtd">
3)Frameset :
<!DOCTYPE html PUBLIC "-//W4//DTD XHTML 1.0 Frameset//EN" "DTD/frameset.dtd">
These were the basic rules or the differences of XHTML from HTML. These tips will surely help you in building a simple webpage using XHTML.
Learn more about this author, Avinash Mendha.
Click here to send this author comments or questions.
Below are the top articles rated and ranked by Helium members on:
The key differences between HTML and XHTML
XHTML and HTML are both very similar and yet different in terms of how the coding is set up. To learn XHTML, you must all
HTML (Hyper Text Markup Language) is rapidly being replaced by XHTML(Extensible Hyper Text Markup Language). The differences
In February of 1999 the World Wide Web Consortium (otherwise known as the W3C) released the specifications for XHTML version
Featured Partner
National Center for Policy Analysis (NCPA)
The National Center for Policy Analysis (NCPA) has partnered with Helium, giving you the chance to write for a cause. Browse NCPA's featured titles, pick an issue and write! You can also learn new perspectives on issues that yo...more