Html And Xhtml Tags Are Same?

Discussion in 'HTML & Website Design' started by diam26, Aug 29, 2008.

  1. #1
    Hi Guys,
    I came to know that Html and xhtml tags are same almost except closing tags neccessary in XHtml. so I am confused what other differences are there?
    Is there any extra tags in XHtml?
     
    diam26, Aug 29, 2008 IP
  2. justinlorder

    justinlorder Peon

    Messages:
    4,160
    Likes Received:
    61
    Best Answers:
    0
    Trophy Points:
    0
    #2
    almost the same.
    yes it is a bit different that xhtml need closing tag.

    html xhtml
    <br> <br />
    <img scr= ""> <img scr="" />
    and so on.

    I have read a post today that shock me.
    ie doesn't support xhtml at all.
     
    justinlorder, Aug 29, 2008 IP
  3. diam26

    diam26 Peon

    Messages:
    151
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    That is the only difference? Is there any extra tags or different style to write except closing tags? This is nothing almost 99.99 % the same?
     
    diam26, Aug 29, 2008 IP
  4. luckybee

    luckybee Peon

    Messages:
    151
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #4
    luckybee, Aug 29, 2008 IP
  5. jamesicus

    jamesicus Peon

    Messages:
    477
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Not quite. MSIE Browsers (including IE8) do not support XHTML 1.0 served as Content (MIME) Type application/xhtml+xml which is the way it should be served IAW the W3C specification. Other standards compliant Browsers -- FireFox, Opera, Safari, Mozilla, et al. do support that Content Type thus providing XML functionality. The W3C long ago added Appendix C to the XHTML 1.0 Specification that provides for serving it as Content (MIME) Type text/html -- which is really just HTML using XHTML syntax.

    There is one great advantage in using XHTML (even when served as text/html) versus HTML -- the well-formedness constraints make for better structured Markup for those who do not normally employ that principle when composing HTML pages. However, there is no advantage whatsoever in using valid XHTML 1.0 served as text/html versus well structured, well formed and valid HTML 4.01.

    Here is a page that outlines the problems serving XHTML

    Here is an XHTML page served as content (MIME) type application/xhtml+xml for testing by those interested.

    James
     
    jamesicus, Aug 29, 2008 IP
  6. elfsites

    elfsites Peon

    Messages:
    64
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    XHTML is a stricter version of HTML, it's basically XML and HTML mixed in. It has new rules like you can't have unclosed tags, so <br> is not legal, you need <br/> and tags must be in lower case and so on. There is no reason to use one over the other, you can use whichever you want, as long as you use the proper DOCTYPE declaring which you're using.
     
    elfsites, Aug 29, 2008 IP
  7. diam26

    diam26 Peon

    Messages:
    151
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I understand about the closing tags in XHtml and lower case use but what is major difference other than this? Is tansitional Doctype is the best which can support all other brousers? or the strict one?

     
    diam26, Aug 29, 2008 IP
  8. jamesicus

    jamesicus Peon

    Messages:
    477
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Strictness depends on what Doctype/DTD is used -- strict versions of HTML 4.01 and XHTML 1.0 do not utilize deprecated elements/attributes and render in standards mode.

    Only when XHTML 1.0 is served as application/xhtml+xml is it extensible-- if it is served as text/html (as it mostly is) it is nothing more than HTML using XHTML syntax.

    James
     
    jamesicus, Aug 29, 2008 IP