PDA

Click to See Complete Forum and Search --> : The XHTML QuickTipz Guide



Cemrin
02-10-2007, 04:04 PM
XHTML: Extended Hyper-Text Markup Language


Introduction

XHTML is a subset markup language combining the power of XML with the user-friendly versatility of HTML. This markup language is very similar to HTML, but uses an XML syntax for all "empty" HTML tags and attributes (tags that do not have a closing tag).

The W3 (World Wide Web) Consortium recommends using XHTML as the "Codebase" (the code which lays the "foundation" of your page) for your website. Added to this, CSS Stylesheets execute more accuretely under an XHTML codebase.

The difference in Markup

Here's a list of the differences that XHTML has in its markup and syntax:


Doctype must be supplied
All tags must be lowercase
All "empty" tags must use an XML Syntax
All attributes must contain quotes around them
All language attributes must use the xml:lang element
"name" attribute is replaced by "id" (Can use both for cross-browser interpolation)

--------------------------------------------------------------------------------------
Examples

Lowercase tags

HTML:


<TABLE BORDER="1">
XHTML:


<table border="1">

Empty Tags Syntax

HTML:


<img src="http://www.website.com/image1.jpg">
XHTML:


<img src="http://www.website.com/image1.jpg" />

"Name" attribute replacement

HTML:


<iframe src="http://www.mysite.com/frame_a.html" name="main">
</iframe>
XHTML:


<iframe src="http://www.mysite.com/frame_a.html" id="main">
</iframe>

The xml:lang element


<div lang="no" xml:lang="no">Text with no language specification</div>
--------------------------------------------------------------------------------

Extras

The XHTML Doctype Code (Strict)


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


Links

Validate your XHTML (http://validator.w3.org/)
Learn XHTML at W3Schools (http://www.w3schools.com/xhtml/default.asp?t=02)

--------------------------------------------------------------------------------



QuickTipz Guide ::: XHTML: Page1
Written by Cemrin
Copyright: 2006-2007
Some Rights Reserved