Magento Expert Forum - Improve your Magento experience

Results 1 to 19 of 19

HTML vs XHTML

  1. #1

  2. #2
    Junior Member Gowebbaby's Avatar
    Join Date
    May 2014
    Location
    700 LOWER STATE RD, 19B3 NORTH WALES, PA 19454
    Posts
    42
    Thanks
    1
    Thanked 4 Times in 4 Posts

    Default

    The Most Important Differences between XHTML and html
    XHTML:
    XHTML stands for EXtensible HyperText Markup Language
    XHTML is almost identical to HTML 4.01
    XHTML is a stricter and cleaner version of HTML
    XHTML is HTML defined as an XML application

    HTML
    Start tags are not required for every element.
    End tags are not required for every element.
    Only void elements such as br, img, and link may be “self-closed” with />.
    Tags and attributes are case-insensitive.
    Attributes do not need to be quoted.
    Some attributes may be empty (such as checked and disabled).
    Special characters, or entities, do not have to be escaped.
    The document must include an HTML5 DOCTYPE.

    Hire Magento Developer for your Business growth.

  3. #3
    New member
    Join Date
    Jun 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Both are from SGML family and markup languages. HTML and XHTML used for creating free business website .HTML is the basis of every website. XTHML stricter in how tit interpreted. XHTML is cleaner version of HTML.XHTML contain more advanced coding system.In XHTML element must be properly nested but in HTML some element can be improperly nested.XHTML document must be well-formed.

  4. #4
    Junior Member
    Join Date
    Aug 2014
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    XHTML stands for EXtensible HyperText Markup Language.HTML stands for hyper text mark up language.

  5. #5
    Junior Member
    Join Date
    Oct 2014
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You can convert HTML into XHTML as:
    Add an XHTML <!DOCTYPE> to the first line of every page
    Add an xmlns attribute to the html element of every page
    Change all element names to lowercase
    Close all empty elements
    Change all attribute names to lowercase
    Quote all attribute values

  6. #6
    New member
    Join Date
    Mar 2015
    Location
    Chennai
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

  7. #7
    Junior Member
    Join Date
    Feb 2015
    Posts
    53
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    I think basically it does not differ much, you find out more specific details will see its good points

  8. #8
    Junior Member
    Join Date
    Feb 2015
    Posts
    316
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    HTML ---- HTML or HyperText Markup Language is the main markup language for creating web pages and other information that can be displayed in a web browser.
    XHTML ------ XHTML (Extensible HyperText Markup Language) is a family of XML markup languages that mirror or extend versions of the widely used Hypertext Markup Language (HTML), the language in which web pages are written.

  9. #9
    Junior Member thaonvp's Avatar
    Join Date
    Mar 2015
    Posts
    42
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    XHTML is not so much different from HTML 4.01 standard. The major differences are:

    XHTML elements must be properly nested.
    XHTML elements must always be closed.
    XHTML elements must be in lowercase.
    XHTML documents must have one root element.

  10. #10
    Junior Member
    Join Date
    Jan 2015
    Posts
    195
    Thanks
    3
    Thanked 4 Times in 4 Posts

    Default

    HTML and XHTML are both languages in which web pages are written. HTML is SGML-based while XHTML is XML-based. They're like two sides of the same coin. XHTML was derived from HTML to conform to XML standards. Hence XHTML is strict when compared to HTML and does not allow user to get away with lapses in coding and structure.

  11. #11
    Junior Member
    Join Date
    Jan 2015
    Posts
    97
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    HTML and XHTML are both languages in which web pages are written. HTML is SGML-based while XHTML is XML-based. They are like two sides of the same coin. XHTML was derived from HTML to conform to XML standards. Hence XHTML is strict when compared to HTML and does not allow user to get away with lapses in coding and structure.

  12. #12
    Junior Member
    Join Date
    Mar 2015
    Posts
    295
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Default

    HTML and XHTML are both languages in which web pages are written. HTML is SGML-based while XHTML is XML-based. They are like two sides of the same coin. XHTML was derived from HTML to conform to XML standards. Hence XHTML is strict when compared to HTML and does not allow user to get away with lapses in coding and structure.
    The reason for XHTML to be developed was convoluted browser specific tags. Pages coded in HTML appeared different in different browsers.

  13. #13
    Junior Member MrJaswal's Avatar
    Join Date
    Apr 2015
    Location
    Ludhiana,Punjab,India
    Posts
    29
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    You want to know what id the difference Between HTML and XHTML then, i will share my knowledge with you lara.

    First i will explain you what is HTML, Html is a hypertext markup language, html was designed to display the data, html is about displaying the information and html tags are predefined you didn't need to define.

    Now, i will explain with you what is XHTML. XHTML stands for EXtensible hypertext Markup Language, XHTML is strict when compared to HTML and does not allow user to get away with lapses in coding and structure.

  14. #14
    New member
    Join Date
    Nov 2015
    Location
    San Jose, CA
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    HTML is a standard language for web page designing with some static tags and basic text.
    Whereas, XHTML is just an extension of HTML and it supports XML language and its code needs to be parsed with XML parser before running.

  15. #15
    Junior Member
    Join Date
    Apr 2015
    Posts
    109
    Thanks
    0
    Thanked 8 Times in 8 Posts

    Default

    HTM Is a standard language for web page designed with tags and basic text.

  16. #16
    Junior Member
    Join Date
    Jan 2016
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You will understand the difference properly if you know about XML.

    As an overview, XHTML is basically HTML with all the standards and strict rules(like which are followed by XML) while HTML is not bound by standards.

  17. #17
    Junior Member
    Join Date
    Mar 2016
    Posts
    95
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Short answer is : xHTML is XML, HTML is not XML.

  18. #18
    Junior Member
    Join Date
    Mar 2016
    Posts
    209
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Default

    HTML or HyperText Markup Language is the main markup language for creating web pages and other information that can be displayed in a web browser.

    XHTML (Extensible HyperText Markup Language) is a family of XML markup languages that mirror or extend versions of the widely used Hypertext Markup Language (HTML), the language in which web pages are written

  19. #19
    New member
    Join Date
    Jul 2016
    Location
    Virginia
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Due to the fact that XHTML is an XML application, certain practices that were perfectly legal in SGML-based HTML 4 must be changed. You already have seen XHTML syntax in previous chapter, so differences between XHTML and HTML are very obvious. Following is the comparison between XHTML and HTML.

    XHTML Documents Must be Well-Formed
    Well-formedness is a new concept introduced by XML. Essentially, this means all the elements must have closing tags and you must nest them properly.

    CORRECT: Nested Elements

    <p>Here is an emphasized <em>paragraph</em>.</p>
    INCORRECT: Overlapping Elements

    <p>Here is an emphasized <em>paragraph.</p></em>
    Elements and Attributes Must be in Lower Case
    XHTML documents must use lower case for all HTML elements and attribute names. This difference is necessary because XHTML document is assumed to be an XML document and XML is case-sensitive. For example, <li> and <LI> are different tags.

    End Tags are Required for all Elements
    In HTML, certain elements are permitted to omit the end tag. But XML does not allow end tags to be omitted.

    CORRECT: Terminated Elements

    <p>Here is a paragraph.</p><p>here is another paragraph.</p>
    <br><hr/>
    INCORRECT: Unterminated Elements

    <p>Here is a paragraph.<p>here is another paragraph.
    <br><hr>
    Attribute Values Must Always be Quoted
    All attribute values including numeric values, must be quoted.

    CORRECT: Quoted Attribute Values

    <td rowspan="3">
    INCORRECT: Unquoted Attribute Values

    <td rowspan=3>
    Attribute Minimization
    XML does not support attribute minimization. Attribute-value pairs must be written in full. Attribute names such as compact and checked cannot occur in elements without their value being specified.

    CORRECT: Non Minimized Attributes

    <dl compact="compact">
    INCORRECT: Minimized Attributes

    <dl compact>
    Whitespace Handling in Attribute Values
    When a browser processes attributes, it does the following −

    Strips leading and trailing whitespace.

    Maps sequences of one or more white space characters (including line breaks) to a single inter-word space.

    Script and Style Elements
    In XHTML, the script and style elements should not have “<” and “&” characters directly, if they exist; then they are treated as the start of markup. The entities such as “<” and “&” are recognized as entity references by the XML processor for displaying “<” and “&” characters respectively.

    Wrapping the content of the script or style element within a CDATA marked section avoids the expansion of these entities.

    <script type="text/JavaScript">
    <![CDATA[
    ... unescaped VB or Java Script here... ...
    ]]>
    </script>
    An alternative is to use external script and style documents.

    The Elements with id and name Attributes
    XHTML recommends the replacement of name attribute with id attribute. Note that in XHTML 1.0, the name attribute of these elements is formally deprecated, and it will be removed in a subsequent versions of XHTML.

    Attributes with Pre-defined Value Sets
    HTML and XHTML both have some attributes that have pre-defined and limited sets of values. For example, type attribute of the input element. In HTML and XML, these are called enumerated attributes. Under HTML 4, the interpretation of these values was case-insensitive, so a value of TEXT was equivalent to a value of text.

    Under XHTML, the interpretation of these values is case-sensitive so all of these values are defined in lower-case.

    Entity References as Hex Values
    HTML and XML both permit references to characters by using hexadecimal value. In HTML these references could be made using either &#Xnn; or &#xnn; and they are valid but in XHTML documents, you must use the lower-case version only such as &#xnn;.

    The <html> Element is a Must
    All XHTML elements must be nested within the <html> root element. All other elements can have sub elements which must be in pairs and correctly nested within their parent element. The basic document structure is −

    <!DOCTYPE html....>

    <html>
    <head> ... </head>
    <body> ... </body>
    </html>

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
  •