Choose a link to get started:



ALL NEW!!!

Scrolling Marquees


The Basics

The Basics
Manipulating Text
Images
Backgrounds
Links


More Advanced Topics

The <HEAD> Tag
Tables
Forms
Frames
Lists


Advanced Topics

Image Maps
CSS - Part 1
CSS - Part 2
CSS - Part 3
CSS - Part 4


Additional Topics

XML Tag Formatting
XHTML - Part 1
XHTML - Part 2

XHTML Basics - Part One

        So, you want to learn XHTML? Look no furthur. XHTML Basics is the one place to find out how to get it done. Before we get to the tutorial, we must learn a few things about XHTML.

  1. Number One. XHTML stands for eXtensible HyperText Markup Language
  2. Number Two. XHTML requires that all tag names be in lowercase letters, without fail.
  3. Number Three. A new document definition tag is required for XHTML.
  4. Number Four. Every attribute must have quotes around its value.
  5. Number Five. All tags must be ended, regardless if they have an ending tag in HTML or not.
  6. Number Six. Every attribute must have a value.


        Still want to learn XHTML? Yes? Good, because I am here to teach it to you. Our first subject will be on the new document definition. This may look confusing, and sound pointless, but you must use both the XML and XHTML document definitions. This syntax is shown below :

<?xml version "1.0" encoding="UTF-8"?>
<!DOCTPYE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">


        Like It? I do not know why exactly both must be used, but use both for XHTML pages anyway.



        Our next subject is that every attribute must have quotes around its value. For example, in table, you could get away with

cellspacing=5

        You cannot do that any more. Every attribute must have quotes around its value.



        Having fun yet? Before we get to ending endless tags, we will discuss attributes that have no values. Here are a few examples from HTML.

<INPUT TYPE="radio" checked>
<HR noshade>


        This would be illegal in XHTML. This is easily corrected, however, as the value for these attributes is the name of the attribute. Here are the corrected versions :

<input type="radio" checked="checked">
<hr noshade="noshade">




        Our final topic of this tutorial on XHTML is that all tags must be ended without fail. But what about the tags like <HR> and <BR>? They have a space after the last attribute, or tag name if there are no attributes, and then an ending slash. Here are the correct and incorrect versions.

INCORRECTCORRECT
<HR><hr />
<BR><br />


        Did everyone have fun today? Go to XHTML - Part 2 to keep learning. Good Luck with XHTML!!