Results 1 to 6 of 6

Convert HTML to XHTML

This is a discussion on Convert HTML to XHTML within the Web Design forums, part of the Web Designing & Development category; There are a few basic rules you need to apply to convert an HTML 4 document to XHTML. 1. Stricter ...

  1. #1
    Senior Member Array akash's Avatar
    Join Date
    Oct 2008
    Location
    Heaven (Earth)
    Posts
    500

    Default Convert HTML to XHTML

    There are a few basic rules you need to apply to convert an HTML 4 document to XHTML.

    1. Stricter adherence to the HTML specification.
    Many browsers are very lax in how they interpret HTML. This leads to incongruities in how the pages are displayed, and XHTML doesn't allow that. The best way to correct this is to use an XHTML validator.

    2. Write well formed documents.
    What this generally means is avoiding overlapping elements. The following nested code is acceptable:

    <p>Paragraph <em>emphasized</em></p>

    because the <em> tag is opened and closed within the <p> tag. However, this is not allowed:

    <p>Paragraph <em>emphasized</p></em>

    because the <em> tag overlaps the <p> tag.

    3. Write tags and attributes in lowercase.
    XHTML is a case-sensitive markup language, so

    <LI> and <li>

    are potentially two different tags.

    4. End tags are required.
    In HTML, some tags which actually contain elements do not require the end tag. The most common of these is the

    <p>

    tag. XHTML requires that the

    </p>

    tag be used. For singleton tags, such as

    <br>

    you should include a trailing slash in the tag itself, e.g.

    <br />

    to get a line break.

    5. Attributes must be quoted and include values.
    What this means is that non-quoted attributes such as

    <table border=3>

    are invalid. And attributes which used to stand alone, must now be written as name="value" pairs. For example

    <hr noshade="noshade" />

    adds the noshade attribute to the <hr/> tag.

    6. Do a second validation.
    The last step is to validate your XHTML again. This will tell you of any additional problems or issues with your code.

  2. #2
    Administrator Array SticKer's Avatar
    Join Date
    May 2007
    Posts
    3,700

    Default Re: Convert HTML to XHTML

    Thanks for sharing.

    SticKer

    Buy / Sell / Trade Products and Services at our Webmaster Marketplace

    61 Ways To Drive Targeted Traffic To Your Website

  3. #3

  4. #4
    Senior Member Array
    Join Date
    Nov 2008
    Posts
    191

    Default Re: Convert HTML to XHTML

    Thanks for information. I'm interesded in #5
    Attributes must be quoted and include values

  5. #5
    Member Array
    Join Date
    Jan 2009
    Posts
    64

    Default Re: Convert HTML to XHTML

    You would be surprised at how many new sites I'm seeing put up by local designers that still use invalid HTML 4. XHTML has so many advantages over HTML.
    Custom Web and database solutions from a Milwaukee Web Designer and SEO Company in Milwaukee.

  6. #6
    Senior Member Array akash's Avatar
    Join Date
    Oct 2008
    Location
    Heaven (Earth)
    Posts
    500

    Default Re: Convert HTML to XHTML

    originally posted by Demtron.
    You would be surprised at how many new sites I'm seeing put up by local designers that still use invalid HTML 4. XHTML has so many advantages over HTML.
    I completely agree with you that xhtml is better than html.
    I am just sharing that how can you convert html to xhtml...



Similar Threads

  1. Replies: 3
    Last Post: 03-19-2011, 10:30 PM
  2. Common errors in xhtml
    By orlando in forum Web Design
    Replies: 1
    Last Post: 01-10-2009, 05:49 AM
  3. convert to xml file?
    By f f in forum Scripts & Content Management
    Replies: 0
    Last Post: 02-01-2008, 08:43 PM
  4. Convert your traffic into money
    By Sam David in forum Affiliate Marketing
    Replies: 2
    Last Post: 08-29-2007, 11:13 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
SEO Forum | Web Hosting Forum | Websites For Sale |