Welcome
Arachne's Web
A group focused on serving the AW community by providing help and discussion on topics such as HTML, CSS, web design, homesite decorating, netiquette and issues important to web artists.

Arachnids are such Show Offs! (- threads, 348 posts)
    HTML Advanced & XHTML Tutorials (10 posts)
    Social Thread

    ...
    0 Members have made 0 Posts here to date.
    Google
    AncientWorlds.net Web
    Next: XHTML tag reference (repost)
    Prev: 1.1 Introduction - Brief History
    1.2 Basic differences between HTML and XHTML
    bithiahavatar_trans.gif
    Author: * Bithiah Nebet - 0 Posts on this thread out of 48 Posts sitewide.
    Date: Nov 3, 2003 - 03:05

    This tutorial focuses on some of the basic differences between HTML and XHTML. Keep in mind that XHTML is the next evolutionary step in the HTML family. The tags used to create an HTML web page are the same tags used to create an XHTML web page.

    The main differences between HTML and XHTML:

    1. All XHTML pages must include a DOCTYPE declaration.

    The first item on an HTML page is normally the <html> tag. This is no longer the case. There are a few pieces of markup that must come at the beginning of any XHTML document. In this tutorial, we'll focus on the DOCTYPE declaration, which looks like this:

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

    2. All tags must be lowercase.

    XHTML HTML

    <title>Welcome to my page</title>

    <TITLE>Welcome to my page</TITLE>

    3. All tags must have a closing tag.

    XHTML HTML

    <p>Paragraph one</p>

    <p>Paragraph two</p>

    <p>Paragraph one

    <p>Paragraph two

    4. All empty tags (like <hr>, <img>, <br>) should include a space between the tag name and />.

    XHTML HTML

    <br />

    <img />

    <br>

    <img>

    5. All tags must be nested correctly.

    XHTML HTML

    <p><b>This is correct</b></p>

    <p><b>This is not correct</p></b>

    6. All attributes must have values and those values must be contained by quotation marks.

    XHTML HTML

    <font face="Verdana">I love Egypt</font>

    <font face=Verdana>I love Egypt</font>

    *This means that the standalone attributes used in HTML (such as <td nowrap>) are no longer valid. The correct form is <td nowrap="nowrap">.

    These are the main rules. There are a few other XHTML-specific rules you have to follow as you convert your pages to XHTML, but this tutorial is meant to be an overview, so we won't go into detail.

    An example of a simple XHTML page:

    <!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 page</title>
    </head>
    
    <body>
    <p>Welcome! I'm learning XHTML.</p>
    
    <p>XHTML was created to reduce<br />
    incompatibilities between browsers.</p>
    
    <p>Now most browsers<br /> 
    will show my pages better.</p>
    </body>
    </html>

    Homework?

    If you want to practice, see if you can break up this text into paragraphs and change the font (face and/or color) using the XHTML rules discussed here.

    "By the governor's orders," said he, "conduct the prisoner to the tier beneath." "To the dungeon, then," said the corporal. "Yes; we must put the madman with the madmen." The soldiers seized Dantes, who followed passively. He descended fifteen steps, and the door of a dungeon was opened, and he was thrust in. The door closed, and Dantes advanced with outstretched hands until he touched the wall; he then sat down in the corner until his eyes became accustomed to the darkness. The jailer was right; Dantes wanted but little of being utterly mad.


    NEXT: XHTML tag reference (repost)
    PREV: 1.1 Introduction - Brief History
Rome - Rome, Season 1 - The Stolen Eagle


Copyright 2002-2011 AncientWorlds LLC | Code of Conduct and Terms of Service | Contact Us! | The AncientWorlds Staff