|
HTML Home
HTML TutorialHTML Tutorial HomeAbout HTML Getting Started HTML Elements HTML Formatting HTML Attributes HTML Colors HTML Links HTML Images HTML Meta Tags HTML Comments HTML Forms HTML Tables HTML Image Maps HTML Frames HTML Entities HTML Layouts HTML Styles HTML Scripts HTML Website Templates Website Hosting Summary HTML Code GeneratorsHTML Code GeneratorHTML Table Generator Marquee Generator Music Code Generator HTML Text Generator Text Box Generator Free HTML CodesHTML Background CodeHTML Comment Box Codes HTML Font Codes HTML Picture Codes HTML Marquee Code HTML Music Codes More Codes... HTML ReferenceComplete HTML Tag ListHTML Special Characters Hex Color Codes HTML Help |
XHTML TutorialThis XHTML tutorial demonstrates how to code web pages using XHTML. It assumes that you're already comfortable with HTML. XHTML is almost identical to HTML with only a handful of differences. XHTML is slightly more strict than HTML and requires a little more attention when coding. XHTML was developed by the W3C to help web developers make the transition from HTML to XML. So if you want to learn XML, XHTML is a good place to start. Here are the main things to remember when writing XHTML:
Here's a more detailed explanation of the above XHTML rules. DOCTYPEAll XHTML documents must have a DOCTYPE declaration. The document must include the usual html, head, title, and body elements. Example: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
CaseAll XHTML tags should be lower case. (HTML tags on the other hand, can be upper or lower case). Wrong <A HREF="/xhtml/xhtml_tutorial.html">XHTML Tutorial</A> Right <a href="/xhtml/xhtml_tutorial.html">XHTML Tutorial</a> Closing tagsAll tags should have an opening tag and a closing tag. If it's a tag that doesn't have a closing tag (for example, the Wrong <img src="/pix/xhtml_tutorial.gif">Right <img src="/pix/xhtml_tutorial.gif" /> QuotesIn XHTML, all attribute values must be quoted. (In HTML on the other hand, you could get away without quoting attribute values). Wrong <img src="/pix/xhtml_tutorial.gif" width=250 height=50 border=0 /> Right <img src="/pix/xhtml_tutorial.gif" width="250" height="50" border="0" /> MinimizationMinimization is forbidden. You should explicitly state the attribute and the value. Wrong <option selected> Right <option selected="selected"> The id attributeThe id attribute replaces the name attribute. Instead of using Wrong <img src="/pix/xhtml_tutorial.gif" name="xhtml_tutorial">Right <img src="/pix/xhtml_tutorial.gif" id="xhtml_tutorial">Script tagThe Wrong
Right
NestingAll tags must be nested properly. Wrong <b><i> This text is bold and italic</b></i>Right <b><i> This text is bold and italic</i></b>Apart from these strict rules, you can code your XHTML pages just like you've been coding HTML pages. To learn more about coding HTML, check out the HTML tutorial. Enjoy this website?
Oh, and thank you for supporting Quackit! |
FREE Hosting!With every domain name you register with ZappyHost, you get FREE (ad supported) hosting.PLUS you get:
Featured Template:
(Build your websites in minutes!) Got a MySpace Page?Get "www.yourname.com" for your MySpace page. Learn how >>. |