Home
Plan Your Website
Web Design
Free SBI Web Tools
Create A Free Site
Web Design Tips
Intro To HTML
HTML Tutorial
Register Domain
Choose A Host
Web 101
Google Tips
Earn Money Online
Grow Web Traffic
Web Content
Website Templates
Web Page Software
Intro To CSS
Website Adviser Blog
Site Build It!
Privacy Policy
About Me
Contact Us

[?] Subscribe To This Site's Latest Posts

XML RSS
Add to Google
Add to My Yahoo!
Add to My MSN
Subscribe with Bloglines

 

HTML Tutorial - Part 5 XHTML Coding

You can use this HTML tutorial to learn the basics of this widely used mark-up language. This section tells you about XHTML requirements, headings, and how to build a web page with good form.

An XHTML document is the same as an HTML document except we are going to add some more verbiage (...code). No need to be alarmed --- its not complicated.

Once you know how to structure an XHTML doc you'll be on your way to learning lots more in the XHTML world. It'll be a snap!

Learning how to use some common HTML tags and XHTML tags will increase your ability to create a web page.


HTML Tutorial At A Glance…
---------------------------------------------------------------
    Part 1: The Basics
    Part 2: The Basics
    Part 3: The Basics
    Part 4: Begin Coding In HTML
    Part 5: How To Code An XHTML Web Page
  1. What Are The XHTML Requirements?
  2. <!DOCTYPE> Variations
  3. XHTML Configuration

  4. Part 6: Headings and Meta Tags
    Part 7: How To Create An HTML List
    Part 8: How To Construct HTML Links
    Part 9: Building HTML Tables




  1. What Are The XHTML Requirements?
    First we will add the <!DOCTYPE> tag. This is placed at the beginning of your file. It will indicate to your browser that this is an HTML file that conforms to the XHTML standard requirements.

    A typical <!DOCTYPE> tap will look like this...

    <!DOCTYPE html
    PUBLIC " - //W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1 - transitional.dtd">

    ...and the HTML tag itself is different in an XHTML document.
    We need to add the following attributes to it:

    xmlns

    xml:lang

    lang

    With these added attributes the HTML tag is now structured like this...

    <html xmlns="http://www.w3.org/1999/xhtml"
    xml:lang="en" lang="en">

    • You probably noticed that the letters in <!DOCTYPE> are all in caps -- this tag should aways be in caps. Also, an exclamation must appear before the word DOCTYPE.
    • An XHTML web page requires a full <html> tag;
      <html ... lang="en">.
      The HTML web only requires the <html> tag.
    • When we use the xmlns attribute it links the document to the W3C's definition of the always evolving XHTML language.
    • To recap, remember that for an XHTML web page the <!DOCTYPE...> tag must be at the top and the full <html> tag is used.

  2. <!DOCTYPE> Variations
    There are three types of <!DOCTYPE...> tags...

    Strict, Frameset, and Transitional.


    Note:
    You may want to indent some of your code if that makes it easier to read. I've chosen not to indent through out most of this HTML tutorial because of the screen limitations a some of my visitor's equipment.

    It's your choice of course -- what ever makes you comfortable.


  3. XHTML Configuration
    Let's create your first the XHTML web page. Again you do not have create a new file unless you want to. Modify the existing HTML code.

    The modified code should look like this in your text editor…

  4. <!DOCTYPE html
    PUBLIC " - //W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1 - transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
    xml:lang="en" lang="en">
    <head>
    <title>My XHTML Web Page</title>
    </head>
    <body>
    This sentence will be displayed on my XHTML web page.
    </body>
    </html>


    • Save the file in a folder -- remember to use lowercase characters with an extension type of either .htm or .html.
      Browse it.
    • XHTML Code

    • When you add the XHTML code to the file it does not change the appearance. In this example only the <title> tags and the sentence within the <body> tags was modified.
    • In the next section of this HTML tutorial we'll explore some more widely used tags.


HTML Tutorial At A Glance…
---------------------------------------------------------------
    Part 1: The Basics
    Part 2: The Basics
    Part 3: The Basics
    Part 4: Begin Coding In HTML
    Part 5: How To Code An XHTML Web Page
  1. What Are The XHTML Requirements?
  2. <!DOCTYPE> Variations
  3. XHTML Configuration

  4. Part 6: Headings and Meta Tags
    Part 7: How To Create An HTML List
    Part 8: How To Construct HTML Links
    Part 9: Building HTML Tables


Return from HTML Tutorial Part 5.


footer for html tutorial page