Difference between HTML and XHTML || SGML Application
×

Difference between HTML and XHTML

2370

HTML and XHTML are the web languages. HTML is the standard markup language for documents on the World Wide Web, also HTML is an SGML application (Standard Generalized Markup Language).

It was the based language of the web. The main objective of HTML uses to format documents for display on the web page.

There are different versions of HTML such as HTML 1, 2, 4 etc.

The latest version is HTML5. It is majorly used to develop user interfaces are for front-end development.

Example:

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>

<h1>My First Heading</h1>
<p>My first paragraph.</p>

</body>
</html>

Note:

  • HTML is HyperText Markup Language
  • HTML is less expressive
  • HTML is Developed by Tim Berners-Lee in 1990
  • HTML Version is HTML2, HTML3.2, HTML4.0, HTML5
  • HTML filename extension .html, .htm5
  • HTML type text/html
  • HTML is An application of SGML
  • HTML Can have empty/open tags like e.g. <br>, <hr>
  • HTML Attributes have quoted as optional, like e.g. <font color=#000>
  • HTML is Case insensitive. The tags and attributes can be of uppercase or lowercase as per the preference
  • HTML is not mandatory for one root element.

XHTML - Extensible HyperText Markup Language

XHTML is an almost similar extend or mirror version of HTML.

XHTML (Extensible HyperText Markup Language): XHTML was developed by World Wide Web

Consortium and it was released in the year 2000. It has been extended from XML and HTML.

The filename extension save to .xhtml, .xht, .xml, .html and .htm.

All the XHTML documents should start with the document's declaration at the top.

XHTML is very fast, accurate, easily maintained, editable, and formatted. XHTML always provides a consistent and well-defined structure format for web pages that can be easily processed by web browsers.

Example:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 <title>Title of document</title>
</head>  
<body>
 <h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>  
</html>

Note:

  • XHTML is Extensible HyperText Markup Language
  • XHTML is more expressive as compared to HTML
  • XHTML is developed by World Wide Web Consortium
  • XHTML Version is XHTML.1, XHTML1.1, XHTML.2, XHTML.5
  • XHTML filename extension .xhtml, .xht, .xml, .html, .htm
  • XHTML type application/xhtml+xml
  • XHTML is An application of XML
  • XHTML All the unclosed tags must be closed e.g. <br/>, <p></p>
  • HTML Attributes have quotes mandatory. like e.g. <font color="#ff0000?">
  • HTML is Case Sensitive: The tags and attributes must be of lowercase
  • XHTML documents must have one root element


Best WordPress Hosting


Share:


Discount Coupons

Get a .COM for just $6.98

Secure Domain for a Mini Price



Leave a Reply


Comments
    Waiting for your comments