![]() |
Major Differences between HTML and XHTML
There are several relatively small, but important,
differences between HTML and XHTML. They are listed below,
and you should attempt to adhere to them if you wish to
receive full credit in the class.
Every HTML document should
contain this dtd (document type declaration) at the very
top:
Important: Notice the starting header information (including the title) is included so you don't need to include it in your new webpage.
Start with the <body> tag. You should, however, change the title from Your title here to appropriate title.
You may wish to include a link to the XHTML validator... <a href="http://validator.w3.org">Validate</a> All tags must be lower case:
<img src="image.gif"
alt="image">
not <IMG
SRC="IMAGE.GIF" ALT="IMAGE">
All tags must be closed. For HTML tags that do not require a close use: space/>
<img src="image.gif"
alt="image" />
All attributes must be lower case and use quotes:
<body bgcolor="#000000">
Single word attributes such as <hr noshade> must contain a value:
<br noshade="noshade" />
All tags must be nested properly:
<strong><em>some text</em></strong> not <strong><em>some text</strong></em>
Image tags must use the alt attribute:
<img src="image.gif"
alt="image" />
Special characters must use their corresponding name codes:
&=&
Links should include an id attribute as well as a name attribute:
<a href="http://google.com"
id="google"
name="google">Google</a>
Javascript must be placed in the <head> section with the following CDATA markers:
<script>
<[CDATA[ javascript... ]]> </script> |
|