Tuesday, September 20, 2011

10 - XHTML


   What is XHTML?


    .XHTML is much strict version of HTML.
    .XHTML is stands for Extensible HyperText Markup Language.
    .XHTML 1.0 is almost equal to HTML 4.01.



   Changes in XHTML?


1) XHTML Elements must closed.

    The following code just work fine for HTML.

    <html>
    <head>
    <title>This is bad HTML</title>
    <body>

    <h1>closing tags missing in h1 and p

    <p>This is a paragraph

    </body>

2) XHTML Elements properly nested

    Imporper  tags in HTML works fine. like

    <b><i>This text is bold and italic</b></i>

    XHTML must be properly nested. like

    <b><i>This text is bold and italic</i></b>


3) Empty tags must be closed

    Non- Empty tags work fine in HTML. like

    A break: <br>
    A horizontal rule: <hr>
    An image: <img src="happy.gif" alt="Happy face">

    In XHTML Empty tags must be closed. like

    A break: <br />
    A horizontal rule: <hr />
    An image: <img src="happy.gif" alt="Happy face" />

4) XHTML Elements Must be in Lower Case.

    wrong coding

    <BODY>
    <P>This is a paragraph</P>
    </BODY>

    correct coding

    <body>
    <p>This is a paragraph</p>
    </body>


 powered by multimediagyan ©

No comments:

Post a Comment