Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: XHTML Tutorial

  1. #1
    Good Day DTians,

    After the completion of HTML tutorials,i am back agin to introduce XHTML tutorials.HTML Tutorials really took off,Rahen did a brilliant job continuing them and also giving it the proper climax through examples and other citations.

    Ill give a brief introduction in XHTML and then continue with the classes.

    XHTML as i can explain is a more cleaner,stronger and stricter version of HTML.

    Pls note-Before you continue you should have a basic understanding of
    "HTML and basics of building web pages" ..

    Lets continue then-

    Q.Firstly,What Is XHTML?
    A.XHTML stands for EXtensible HyperText Markup Language .It is aimed at replacing HTML.It is identical to the HTML v 4.01.

    In another definations,XHTML=HTML defined as an XML application
    ---------------------------------------------------------------------------

    Outlining the tutorials,my further classes will cover the following Topics-

    .Why you should use XHTML
    .The syntax of XHTML
    .XHTML validation

  2. #2
    Good Job :up;
    waiting for more...Thank you...



  3. #3
    Thankoo.Thankoo.

    Be tuned in for the updates.

  4. #4

  5. #5
    Class1-"Why you should use XHTML?"

    I hope you people have browsed through the introduction notes.Lets continue with the
    class 1.Todays topic is-

    "Why you should use XHTML?"

    Now this question has a very simple and a logical answer.To get to know a subject one must be well equipped with all the answers that deals with a subjects credibility.
    Ok so here it is.The fact is,We have reached a point where many pages on the WWW contain "bad" HTML."bad" in the sense the basic rules of html tag ends is hardly followed these days...

    The following HTML code will work fine if you view it in a browser, even if it does not follow the HTML rules:



    One thing i missed in the intro was telling you about XML.

    "XHTML consists of all the elements in HTML 4.01 combined with the syntax of XML.

    XML is a markup language where everything has to be marked up correctly, which results in "well-formed" documents.

    So the function of XML and HTML go as follows:-

    XML was designed to describe data and HTML was designed to display data.

    Today's market consists of different browser technologies, some browsers run Internet on computers, and some browsers run Internet on mobile phones and hand helds. The last-mentioned do not have the resources or power to interpret a "bad" markup language.

    Therefore - by combining HTML and XML, and their strengths, we got a markup language that is useful now and in the future - XHTML.

    XHTML pages can be read by all XML enabled devices AND while waiting for the rest of the world to upgrade to XML supported browsers, XHTML gives you the opportunity to write "well-formed" documents now, that work in all browsers and that are backward browser compatible !!!

    What you sitting in for ...

    Class Dismissed

  6. #6
    Class 2-"The Syntax of HTML"

    Hello folks,

    Hope you are all doing well.Since the syntax is a bit lengthy i broke the topic into two for comfortable and pleasant study.

    Continuing-

    XHTML when written demands a cleaner HTML syntax.

    So a cleaner HTML syntax forms the first rule . A few other XHML syntax rules are as follows-

    a.Attribute names must be in lower case

    b.Attribute values must be quoted

    c.Attribute minimization is forbidden

    d.The id attribute replaces the name attribute

    e.The XHTML DTD defines mandatory elements

    ---------------------------------------------------------------------------------------------------

    Lets do a casestudy of the above syntax rules.Take the first rule down

    a.Attribute Names Must Be In Lower Case

    This is wrong:
    http://media0.dropshots.com/photos/1...725/235353.jpg

    This is correct:
    http://media1.dropshots.com/photos/1...725/235954.jpg

    --------------------------------------------------------------------------------

    b.Attribute Values Must Be Quoted

    This is wrong:
    http://media0.dropshots.com/photos/1...726/000054.jpg

    This is correct:
    http://media2.dropshots.com/photos/1...726/000209.jpg

    --------------------------------------------------------------------------------

    c.Attribute Minimization Is Forbidden

    This is wrong:
    http://media2.dropshots.com/photos/1...726/000551.jpg

    This is correct:
    http://media1.dropshots.com/photos/1...726/000724.jpg

    Here is a list of the minimized attributes in HTML and how they should be written in XHTML:
    http://media0.dropshots.com/photos/1...726/001329.jpg

    --------------------------------------------------------------------------------

    The id Attribute Replaces The name Attribute

    HTML 4.01 defines a name attribute for the elements a, applet, frame, iframe, img, and map. In XHTML the name attribute is deprecated. Use id instead.

    This is wrong:
    http://media0.dropshots.com/photos/1...726/001545.jpg

    This is correct:
    http://media2.dropshots.com/photos/1...726/001640.jpg

    Note: To interoperate with older browsers for a while, you should use both name and id, with identical attribute values, like this:
    http://media2.dropshots.com/photos/1...726/001922.jpg

    IMPORTANT Compatibility Note:
    To make your XHTML compatible with today's browsers, you should add an extra space before the "/" symbol.

    --------------------------------------------------------------------------------

    The Lang Attribute

    The lang attribute applies to almost every XHTML element. It specifies the language of the content within an element.
    If you use the lang attribute in an element, you must add the xml:lang attribute, like this:

    http://media1.dropshots.com/photos/1...726/002029.jpg
    --------------------------------------------------------------------------------

    Mandatory XHTML Elements

    All XHTML documents must have a DOCTYPE declaration. The html, head and body elements must be present, and the title must be present inside the head element.
    This is a minimum XHTML document template:
    http://media1.dropshots.com/photos/1...726/002308.jpg

    Note: The DOCTYPE declaration is not a part of the XHTML document itself. It is not an XHTML element, and it should not have a closing tag.

    More Later.Class Dismissed.

  7. #7
    brilliant work up there...easy to understand...well explained...:up;



  8. #8
    ThankYou RAHEN.

    Making it easy and understandable has been the core focus here.

  9. #9
    Hands on Yunus! I am loving the detail that you've provided here.
    Dream, I do.

  10. #10
    Class 4-140207

    Assalaams and hello..

    The tut is back to stage after 4 months or more.I was tied up with exams and college.Without wasting more time..Heres your tut for today.

    More info on DOCTYPE

    A DOCTYPE declaration if validaion has to be done for a correct XHTML.
    But fortunately/unfortunately newer browsers (like I 6) might treat the document differently depending on the <!DOCTYPE> declaration. If the browser reads a document
    with a DOCTYPE, it might treat the document as "correct".Deformed XHTML page might fall over and display differently than without a DOCTYPE.


    Lower Case Tag And Attribute Names

    Since XHTML is case sensitive, and since XHTML only accepts lower case HTML tags and attribute names, a general search and replace function was executed to replace all upper case tags with lowercase tags. The same was done for attribute names.


    Attributes must be Quoted

    Since the XHTML 1.0 Recommendation states that all attribute values must be quoted, every page should have attributes values properly quoted.

    Empty Tags

    <hr> , <br> and <img>

    Empty tags are useless in XHTML. The <hr> and <br> tags should be replaced with <hr /> and <br />.


    An XHTML document is always validated against a Document Type Definition which strictly refers to the XHTML 1.0 Recommendation ..

    An XHTML document is validated against a Document Type Definition (DTD). Before an XHTML file can be properly validated, a correct DTD must be added as the first line of the file.

    Hope you could get into the topic back again..going through all the tuts from the start might help..Sorry for any hindrance in your learning process..Will try to be punctual hence..

    Keep well..

    Class dismissed.

Posting Permissions

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