/    Sign up×
Community /Pin to ProfileBookmark

HTML vs XHTML

Hi,

Programmer poin of view, Is there any big change in XHTML compared to HTML?

I have some basics of XHTML, as given below:

  • 1. All your markup needs to be in lower case

  • 2. Every tag must have corresponding ending tag

  • 3. Some tag don’t have corresponding ending tag, those tags to be backward compatible will look like <br />

  • 4. Every attribute value must be in double quote
    5.Nesting must be correct

  • 6. Ampersand within an attribute value must use its character entity reference.

  • 7. Markup must be well-formed
  • only we need to follow these rules or do we need to learn more in XHTML?
    Thanks

    to post a comment
    HTML

    4 Comments(s)

    Copy linkTweet thisAlerts:
    @disgracianMar 31.2007 — Any embedded scripts have to be escaped (rather cumbersomely in my opinion) in order to pass validation checks, e.g.:
    <i>
    </i>&lt;script type="text/javascript"&gt;
    /* &lt;![CDATA[ */
    function doSomething(){
    // do stuff...
    }
    /* ]]&gt; */
    &lt;/script&gt;

    In my opinion, XHTML is completely pointless since virtually all websites are served as text/html anyway (because no version of IE recognises XHTML), so they are in effect conventional old HTML documents for all intents and purposes.

    The W3C validator for HTML is very slack compared to the XHTML one, so the only value it may have is for learning HTML from scratch. Once you've learned to write well formed XHTML, change the doctype, drop the slash character from empty tags and write HTML.

    Cheers,

    D.
    Copy linkTweet thisAlerts:
    @Stephen_PhilbinMar 31.2007 — If you'd like to do the utterly pointless and send HTML riddled with syntax errors, then take a peek at this.

    http://www.w3.org/TR/xhtml1/#guidelines
    Copy linkTweet thisAlerts:
    @ray326Mar 31.2007 — XHTML is XML, HTML is not. Unless you have a real reason to be using XML then stick with HTML 4.01 Strict.
    Copy linkTweet thisAlerts:
    @felgallMar 31.2007 — Of the 7 points raised - anyone writing decent HTML will be following all but point 3 since even though the other 6 points are optional in HTML for browsers, good coding practice means that you should apply those anyway. The only difference for those six points is that XHTML enforces them while HTML requires the browser to fix your code if you don't apply them yourself (although some browsers convert all tags to uppercase rather than lowercase when interpreting them).
    ×

    Success!

    Help @pskumar spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.19,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...