The difference between XHTML and HTML _css/html

Source: Internet
Author: User
Translation: Linyupark

You can prepare yourself for XHTML by starting to write strict HTML.
You can start by writing strict HTML code to prepare for your xhml.


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

How to Get the ready for XHTML
How do you prepare for XHTML?
XHTML is the next generation of HTML, but it'll of course take some time before browsers and other software Ready for it.
XHTML is the next-generation language for HTML, but it will take a long time to become popular before new browsers and other related software products appear.

In the meantime there is some important things you can does to prepare yourself for it. As you'll learn from the tutorial, XHTML is not very different from HTML 4.01, so bringing your code up to 4.01 Standar DS is a very good start. We complete the HTML 4.01 reference can help you with the.
In the meantime, do something important to prepare for it. As you can learn from this tutorial, XHTML is not much different from HTML4.01, so rewriting your code to conform to the HTML4.01 standard is a great start, and our complete HTML4.01 reference can help you solve the problem.

In addition, should-start now-to-write your HTML code in lowercase letters, and never make the bad habit of skipping E nd tags like the

.
In addition, now you should start writing your HTML code in lowercase letters, and never have to skip like that before.

Such a bad habit of ending the tag.

Happy coding!
Happy Coding!


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

The most Important Differences:
A very important difference:
XHTML elements must be properly nested
XHTML elements must be properly nested
XHTML documents must be well-formed
XHTML documents must be formatted correctly
Tag names must is in lowercase
Label name must be lowercase
All XHTML elements must be closed
All XHTML elements must be closed

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

Elements must be properly Nested
Elements must be properly nested
In HTML some elements can is improperly nested within each other like this:
Some elements in HTML may not use the correct nesting of each other like this:

This text is bold and italic In XHTML all elements must is properly nested within each other like this:
All elements in XHTML must be reasonably nested with each other like this:

This text is bold and italic Note:a common mistake in nested lists, was to forget that the inside list must being within A li element, like this:
Note: When nesting a list, you often make a mistake, forgetting that the new list inserted in the list must be in a

  • Tag, like this:


    • Coffee

    • Tea

      • Black Tea

      • Green Tea


    • Milk

    This is correct:
    This is the right thing to do:


    • Coffee

    • Tea

      • Black Tea

      • Green Tea



    • Milk

    Notice that we have inserted a
  • Tag after thetag in the "correct" code example.
    In this correct code example, be aware that theAnd then I added one.Label


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

    Documents must be well-formed
    Document format must be qualified
    All XHTML elements must is nested within the root element. All other elements can has sub (children) elements. Sub elements must is in pairs and correctly nested within their parent element. The basic document structure is:
    All XHTML tags must be nested within the root tag. All other tags can have their own sub-tags. Child tags that are inside the parent tag must also be paired and properly nested. The basic structure of a Web page is:


    ...
    ...

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

    Tag Names must is in Lower case
    Label name must be lowercase
    This was because XHTML documents is XML applications. XML is case-sensitive. Tags like
    and
    is interpreted as different tags.
    This is because the XHTML document is an XML application, and XML is case-sensitive, like
    And
    are considered to be two different tags.

    This is wrong:
    This is wrong:


    This is a paragraph


    This is correct:
    That's right:


    This is a paragraph


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

    All XHTML Elements must be Closed
    All XHTML elements must be closed
    Non-empty elements must has an end tag.
    Non-empty elements must have a close tag.

    This is wrong:
    This is wrong:

    This is a paragraph

    This is another paragraphthis is correct:
    The correct is this:

    This is a paragraph


    This is another paragraph

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

    Empty Elements must Also be Closed
    The empty element must also be closed
    Empty elements must either has an end tag or the start tag must end with/>.
    An empty element must also have an end tag or start tag ending with/>.

    This is wrong:
    This is wrong:

    This was a break

    Here comes a horizontal rule:
    Here's an image of this is correct:
    That's right:

    This was a break

    Here comes a horizontal rule:

    Here "s an image
    IMPORTANT Compatibility Note:
    Note the key to compatibility:
    To make your XHTML compatible with today's browsers, you should add a extra space before the "/" symbol like this:
    , and this: .
    In order for your XHTML to be compatible with the current browser, you must add a special space before the/symbol, like this:
    And this:
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.