To go with html 4.0 or xhtml transitional 1.0?

Discussion in 'HTML & Website Design' started by TopDraw, Jan 7, 2007.

  1. #1
    Hi,

    I've wondered why we need to convert html into xhtml? Cos there are some parts of html that are considered not validated with xhtml, and yet are perfectly fine in html.

    If I were to convert all the pages into xhtml strict....would many people using older browsers or even IE have problems?

    I'm thinking of just converting to xhtml transitional 1.0 is it good enough? Also, I've converted my pages into xhtml in Dreamweaver 8 but according to the W3.org checker...there's still lots of errors??
    Opinions sought..
     
    TopDraw, Jan 7, 2007 IP
  2. Cypherus

    Cypherus Peon

    Messages:
    1,551
    Likes Received:
    102
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Yes, you should convert your site from html to valid xhtml. Why?

    First of all, xhtml is more structured, is easier to handle and easier to learn. Browsers also deals with xhtml easier, because of the structure - how its builth. That means that users will load your sites faster, when it's made in xhtml. Some important points:

    * Separation of presentation from structure
    * Improved accessibility features
    * Improve internationalization features
    * Improved document rendering

    xhtml is the future, so you might as well start using it now :]
     
    Cypherus, Jan 7, 2007 IP
  3. TopDraw

    TopDraw Active Member

    Messages:
    314
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    58
    #3
    When I did convert a page in Dreamweaver 8, it converted to xhtml transitional, no probs...but when I copy pasted that converted code into the w3.org site and checked, it told me there were so many errors...

    So now I'm wondering about Dreamweaver, ...how accurate is Dreamweaver anyway, (which I hardly even use)...?
     
    TopDraw, Jan 7, 2007 IP
  4. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #4
    You may use html 4.01 or xhtml 1.0 with equal confidence. Both are current standards, xhtml just has fewer optional characteristics. Use well structured, semantic and well formed (valid) markup with either.

    Mark up against a strict DTD either way. There is no sane reason to use deprecated elements or attributes, thus no sane reason to use a transitional or loose DTD.

    Dreamweaver is a wonderful wysiwyg html editor. Everyone should use it. I make my living fixing the crap for code it generates, so by all means, recommend it to all your friends—or at least to those who can afford my services. ;)

    cheers,

    gary
     
    kk5st, Jan 7, 2007 IP
  5. orangelad

    orangelad Peon

    Messages:
    62
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    If you're going to mark up your code against an XHTML DOCTYPE (and you should - you should definitely ditch your old school HTML ways), use XHTML 1.1. It's the most strict and it's not much harder to validate 1.1 than it is XHTML 1.0 Strict.

    Check w3c for an explanation on the subtle differences between the two.
     
    orangelad, Jan 7, 2007 IP
  6. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #6
    Sorry, but that's bad advice. XHTML 1.1 should be served as application/xhtml+xml, and may not be served as text/html. IE does not support that MIMEtype. If you use xhtml 1.1 correctly, no one with IE can visit your site. For an example of a proper xhtml document, see http://garyblue.port5.com/webdev/xhtml/xhtmldoc.html

    When served as application/xhtml+xml, even the slightest error caused the entire document to fail. In my broken example, a single closing tag is missing.
    http://garyblue.port5.com/webdev/xhtml/broken-xhtmldoc.html

    If you want to go with xhtml, stick with 1.0, served as text/html. The browser simply treats it as html.

    cheers,

    gary
     
    kk5st, Jan 8, 2007 IP