1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

w3.org/1999/xhtml line?

Discussion in 'HTML & Website Design' started by Tom_e_rock, Apr 1, 2006.

  1. #1
    <html xmlns="http://www.w3.org/1999/xhtml">

    I'm so confused what this line means?

    and this line aswell

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

    Finally decided to ask what this means
     
    Tom_e_rock, Apr 1, 2006 IP
    Tam likes this.
  2. Tam

    Tam Peon

    Messages:
    89
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Those lines tell your web browser 'how to' interpret and render the code in your web page. Odd DOCTYPE declarations can cause rendering problems in various browser.

    They are discussed in more detail here, here and is discussed in slightly more layman terms here.

    :)
     
    Tam, Apr 1, 2006 IP
    Tom_e_rock likes this.
  3. brian394

    brian394 Well-Known Member

    Messages:
    226
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    108
    #3
    xmlns is an attribute and it stands for XML namespace. It is used in XML documents (most often XHTML and XSL).

    In this example, the XML namespace we are defining has no prefix so it is considered to the be default namespace. An XML namespace with a prefix looks like this...

    <html xmlns:example="http://www.test.com/test">

    This associates the namespace prefix example with the namespace name http://www.test.com/test. Interestingly enough, the URIs used as XML namespace names don't have to point to schemas or even provide information about the namespace. They don't even have to exist. They are only used as unique identifiers.

    The default XML namespace applies to all elements within the document which don't have a prefix.

    Here is an example of an element which has a prefix...

    <p:table><p:tr><p:td>Item 1</p:td><p:td>Item 2</p:td></p:tr></p:table> (In this case, the prefix is p)

    and here is an example of an element which doesn't have a prefix...

    <table><tr><td>Item 1</td><td>Item 2</td></tr></table>

    You may be wondering after all this, what exactly is an XML namespace?
    Well, it is basically a collection or a list of element types and attribute names. It does not contain their definitions (like a DTD does), only their names. If you are confused about the difference between elements and attributes you should read this...

    XML Building Blocks

    So why use them then?
    Well, we use them in cases where we need to provide universally unique names for our elements and attributes.

    You can read more here:

    http://www.w3.org/TR/1999/REC-xml-names-19990114/
    http://www.rpbourret.com/xml/NamespacesFAQ.htm
    http://www.xml.com/pub/a/1999/01/namespaces.html
    http://lucas.ucs.ed.ac.uk/tutorials/namespaces/

    DOCTYPE is short for Document Type Declaration and it informs your browser (and validators) which version of (X)HTML you’re using. DTD's basically describe the structure of your document, and what the legal element and attribute names are inside the document.
     
    brian394, Apr 9, 2006 IP
    Tom_e_rock likes this.