Academic Tutorials



English | French | Portugese | German | Italian
Google

Home Source Codes E-Books Downloads Contact Us About Us

XHTML Tutorial
XHTML Introduction
Why XHTML
Differences Between XHTML And HTML
XHTML Syntax Rules
XHTML DTD
XHTML Elements
XHTML Tag List
XHTML Standard Attributes
XHTML Color Names
XHTML Validation
XHTML Modularization Model
XHTML 7-BIT ASCII Reference
XHTML Entities Reference
XHTML URL-encoding Reference
XHTML HTTP Status Messages
XHTML Event Attributes
XHTML Summary

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
AJAX Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PHP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
.NET (dotnet)
Microsoft.Net
XML Web Services
ASP.Net
.Net Mobile
C# : C Sharp
ADO.NET
VB.NET
Multimedia
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills


Differences Between XHTML And HTML
Previous Next

What makes XHTML different from HTML
  • Tag and attribute names must be in lower-case

  • Elements must be nested properly, no overlapping

  • Non-empty elements must be closed

  • Empty elements must be terminated

  • All attribute values must be quoted

  • Attribute value pairs cannot be shortened

  • <script> and <style> elements


Tag and attribute names must be in lower-case

XHTML element and attribute names must be written in lowercase,as XML is case-sensitive, No longer you can get away with what people did to improve readability of the code— typing the attributes and elements names in uppercase and the values in lowercase. Attribute values can be any case you want. For example, the "#ffcc33" value below can also be written as "#FFCC33."

HTMLXHTML
<TD BGCOLOR="#ffcc33"> <td bgcolor="#ffcc33">


Elements must be nest properly, no overlapping

Browsers wont care overlaped elements in most case. For example, if there is bold tag at the end of a paragraph, it doesnot matters whether to close the </b> first or the </p>. But with XML and XHTML, we have to unclose the last opened tag first and then first opened

HTMLXHTML
<p>Be <b>bold!</p></b> <p>Be <b>bold!</b></p>

Overlapping is widely tolerated in HTML,though it is illegal. An XHTML document must be well-formed XML. It should follow the basic XML syntax. If it fails doing so, There will be no obligation to continue processing of the document bythe XML parser.XML parser will not try to recover and "guess" what you meant if the syntax is wrong as HTML parser did.


Non-empty elements must be closed

either Explicitly or Implicitly all elements must be closed. Since the <p> is designed to mark the beginning and end of a paragraph it is a "non-empty" tag .Thus it must be closed at the end of paragraph

HTMLXHTML
First paragraph<p>
Second paragraph<p>
<p>First paragraph</p>
<p>Second paragraph</p>

Affected Elements: <basefont>, <body>, <colgroup>, <dd>, <dt>, <head>, <html>, <li>, <p>, <tbody>/<thead>/<tfoot>, <th>/<td>, <tr>


Empty elements must be terminated

There are tags which contains no content within them, when we feel there is no important role to play by them, then should delete those empty tags. <p> tag contains a paragraph, and a <b> tag contains text to be bolded, a <br> tag is "empty" as it never contains any content.Other tags like this are <hr> and <img src="valid.gif">

HTML XHTML
                          <hr>                           <hr />
                          <br>                           <br />
                          <input ... >                           <input ... />
                          <param ... >                           <param ... />
                          <img src="valid.gif">                           <img src="valid.gif" />

Affected Elements: <area> <base> <br> <col> <frame><hr><img> <input><isindex><link><meta> <option><param>


All Attribute values must be quoted

No more <img ... border=0>is allowed type.Attribute values including numeric values must be quoted

HTMLXHTML
<img ... border=0> <img ... border="0" />


Attribute value pairs cannot be minimized

Usually we try to minimize the attribute if it has single value.But XML does not allow attribute minimization.Single valued or stand-alone attributes in XHTML must be expanded (eg. <td nowrap>text </td> becomes <td nowrap="nowrap">text</td>). umeric


HTML XHTML
        <dl compact>         <dl compact="compact">
        <ul compact>         <ul compact="compact">
        <option ... selected>         <option ... selected="selected"> >
        <td nowrap> text </td>         <td nowrap="nowrap"> text </td>
       <input type="radio" ... checked>        <input type="radio" ... checked="checked" />
        <input type="checkbox" ... checked>         <input type="checkbox" ... checked="checked" />


<script> and <style> elements

The script and style elements in XHTML, are declared as having #PCDATA content. As a result, < and & will be treated as the start of markup, and entities such as < and & will be recognized as entity references by the XML processor to < and & respectively.We can avoid the expansion of these entities by Wrapping the content of the script or style element within a CDATA marked section. The string which ends the CDATA section."]]>" is The only delimiter that is recognized in a CDATA.


XHTML

                                  <script language="JavaScript type="text/javascript">
                                  <![CDATA[ document.write("<b>Hello World!</b>"); ]]>
                                  </script>


Affected Elements: <basefont>, <body>, <colgroup>, <dd>, <dt>, <head>, <html>, <li>, <p>, <tbody>/<thead>/<tfoot>, <th>/<td>, <tr>



Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • BlinkList
  • blogmarks
  • co.mments
  • connotea
  • del.icio.us
  • De.lirio.us
  • digg
  • Fark
  • feedmelinks
  • Furl
  • LinkaGoGo
  • Ma.gnolia
  • NewsVine
  • Netvouz
  • RawSugar
  • Reddit
  • scuttle
  • Shadows
  • Simpy
  • Smarking
  • Spurl
  • TailRank
  • Wists
  • YahooMyWeb

Previous Next

Keywords: xhtml tutorial, xhtml validator, html xhtml, tag com xhtml, xhtml editor, xhtml templates, xhtml 1.0, xhtml code, xhtml doctype, xhtml validation


HTML Quizes
HTML Quiz
XHTML Quiz
CSS Quiz
TCP/IP Quiz
XML Quizes
XML Quiz
XSL Quiz
XSLT Quiz
DTD Quiz
Schema Quiz
XForms Quiz
XSL-FO Quiz
XML DOM Quiz
XLink Quiz
XQuery Quiz
XPath Quiz
XPointer Quiz
RDF Quiz
SOAP Quiz
WSDL Quiz
RSS Quiz
WAP Quiz
Web Services Quiz
Browser Scripting Quizes
JavaScript Quiz
VBScript Quiz
AJAX Quiz
DHTML Quiz
HTML DOM Quiz
WMLScript Quiz
E4X Quiz
Server Scripting Quizes
ASP Quiz
PHP Quiz
PERL Quiz
SQL Quiz
ADO Quiz
.NET (dotnet) Quizes
Microsoft.Net Quiz
XML Web Services Quiz
ASP.Net Quiz
.Net Mobile Quiz
C# : C Sharp Quiz
ADO.NET Quiz
VB.NET Quiz
Multimedia Quizes
SVG Quiz
Flash Quiz
Media Quiz
SMIL Quiz
Web Building  Quizes
Web Browsers Quiz
Web Hosting Quiz
W3C Quiz
Web Building Quiz
Web Quality Quiz
Web Semantic Quiz
Web Careers Quiz
Java Quizes
Java Quiz
JSP Quiz
Servlets Quiz
Struts Quiz
EJB Quiz
JMS Quiz
JMX Quiz
Programming Langauges Quizes
C Quiz
C++ Quiz
Visual Basic Quiz
Data Structures Using C Quiz
Soft Skills Quizes
Communication Skills Quiz
Time Management Quiz
Project Management Quiz
Team Work Quiz
Leadership Skills Quiz
Corporate Communication Quiz
Negotiation Skills Quiz

Privacy Policy
Copyright © 2003-2008 Vyom Technosoft Pvt. Ltd., All Rights Reserved.