dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Html

  1. #1
    Join Date
    Dec 2009
    Posts
    8

    Html

    What is the difference between HTML and XHTML?

    How can I tell if a code includes XHTML?

    As I understand it XHTML is just well written HTML, so isn't it possible that if you know HTML you maybe accidentally writing XHTML just by using good structure and syntax? So learning to use XHTML doesn't involve much then?

    Is there any difference visually to the users of the webpage?

    I've also heard that HTML 4.0 or something is the same as XHTML, is this true?

    James

  2. #2
    PeejAvery's Avatar
    PeejAvery is offline Super Moderator Power Poster
    Join Date
    May 2002
    Posts
    10,943

    Re: Html

    http://www.w3schools.com/XHTML/xhtml_html.asp

    Quote Originally Posted by JackG View Post
    What is the difference between HTML and XHTML?
    Tag formatting/validation.

    Quote Originally Posted by JackG View Post
    How can I tell if a code includes XHTML?
    By looking at the tag formatting.

    Quote Originally Posted by JackG View Post
    As I understand it XHTML is just well written HTML, so isn't it possible that if you know HTML you maybe accidentally writing XHTML just by using good structure and syntax? So learning to use XHTML doesn't involve much then?
    If you already have HTML, then it's not hard at all to change to XHTML.

    Quote Originally Posted by JackG View Post
    Is there any difference visually to the users of the webpage?
    No.

    Quote Originally Posted by JackG View Post
    I've also heard that HTML 4.0 or something is the same as XHTML, is this true?
    No. They are very similar, but not the same.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3
    Join Date
    Nov 2009
    Posts
    31

    Re: Html

    Way to tell if the code is XHTML or HTML

    HTML the tags are not case senstive, xhtml tages are case senitive and all lower case.

    HTML allows unclosed tages, xhtml does not

    single sided tag like br img and hr are written with a / in xhtml (ie <BR> vs <br />)

    xhtml is served as per standard as application/xhtml+xml (that IE does not follow the standard on) then it strong XML support with stuff like MathML

    if you are look at proper HTML or XHTML and not tag soup then you can tell reading the <!DOCTYPE>

  4. #4
    Join Date
    Jul 2005
    Location
    Currently in Mexico City
    Posts
    568

    Re: Html

    As mentioned above: http://www.w3schools.com/XHTML/xhtml_html.asp

    - document should be well formed;
    - officially xhtml is an xml so it should be read as one and have related content type;
    - all the tags and attributes go in lowercase;
    - all tags should be closed;
    - many attributes have become deprecated;

    Practically xhtml is a stricter version of html and thus cleaner.
    Last edited by Xeel; December 21st, 2009 at 12:09 PM.
    Wanna install linux on a vacuum cleaner. Could anyone tell me which distro sucks better?

    I had a nightmare last night. I was dreaming that Iím 64-bit and my blanket is 32-bit and I couldnít cover myself with it, so Iíve spent the whole night freezing. And in the morning I find that my blanket just had fallen off the bed. =S (from: bash.org.ru)

    //always looking for job opportunities in AU/NZ/US/CA/Europe :P
    willCodeForFood(Arrays.asList("Java","PHP","C++","bash","Assembler","XML","XHTML","CSS","JS","PL/SQL"));

    USE [code] TAGS! Read this FAQ if you are new here. If this post was helpful, please rate it!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)