www.pickatutorial.com Computer Tutorials
Top eBooks: C/C++ | C# | Android | Mathematics | Database | Cloud | Graphics | Networking | Oracle | Hardware | AI
Top Tutorials: C/C++ | C#.NET | PHP MySQL | Java | Java Script | jQuery | HTML | xHTML | HTML5 | VB Script| CSS
Lessons XHTML Tag and Attribute Rules Bookmark and Share
Tutorial Home
Lesson 1
Lesson 2
Lesson 3
Lesson 4
Lesson 5
Lesson 6
Lesson 7
The next XHTML rule says that all XHTML elements and attributes must be in lowercase. It is very common to write an HTML code like the following:

<P>This is a paragraph</P>
<STRONG>This text is bold. </STRONG>
<FONT COLOR="red"> This text is red. </FONT>

The above is valid HTML, but the same is not valid XHTML. XHTML case rule requires us to use lower case in HTML elements and its attributes. Note that we used all uppercase in the elements and attributes above. The correct XHTML version of the above HTML code is as under:

<p>This is a paragraph</p>
<strong>This text is bold. </strong>
<font color="red"> This text is red. </font>

XHTML attribute rule also requires us to properly quote the attribute values. Consider the following example:

<font color=red>
<font color="red>
<font color=red">
<font color='red">
<font color="red'>
<font color='red>
<font color=red'>

All of the above examples are not valid XHTML. The correct code is as under:

<font color='red'>
<font color="red">

Note that the attribute values can be quoted either with a single quote ' or with the double quotes ". Mixed use of quotes e.g. ' " or " ' is not allowed.

Next >>> Lesson No. 6: XHTML DOCTYPE declaration

Home - Advertise - Contact - Disclaimer - About Us
© Since 2006 pickatutorial.com -- All Rights Reserved.