Cover image for There Is More To HTML: Get To Know More About XHTML

There Is More To HTML: Get To Know More About XHTML

Profile image for cindy
cindy Software Lead Engineer
Jan 19, 2022 ‧ 1 min read

XHTML is the abbreviation for eXtensible HyperText Markup Language. It is an open standard for describing web pages that allows you to create web pages more quickly and accurately than the old HTML specifications. XHTML is actually a cross between HTML and XML languages.  

XHTML isn't just another word for HTML, it's actually the next big thing in terms of the future of website development. The reason it will get much attention is due to the fact that it will be used by all browsers and devices, meaning that all websites will be written in XHTML instead of HTML5 or other newer versions of HTML. 

 The XHTML documents contain three parts, which are discussed below: 

  • DOCTYPE: It is used to declare a DTD 
  • head: The head section is used to declare the title and other attributes. 
  • body: The body tag contains the content of web pages. It consists of many tags. 

 The Most Important Differences from HTML 

  • <!DOCTYPE> is mandatory 
  • The xmlns attribute in <html> is mandatory 
  • <html>, <head>, <title>, and <body> are mandatory 
  • Elements must always be properly nested 
  • Elements must always be closed 
  • Elements must always be in lowercase 
  • Attribute names must always be in lowercase 
  • Attribute values must always be quoted 
  • Attribute minimization is forbidden 

XHTML - <!DOCTYPE ....> Is Mandatory

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Title of document</title>
</head>
<body>

  some content here...

</body>
</html>

XHTML Elements Must be Properly Nested

<b><i>Some text</i></b> 

XHTML Attribute Names Must be in Lowercase

<a href="https://www.w3schools.com/html/">Visit our HTML tutorial</a> 

XHTML Attribute Values Must be Quoted

<a href="https://www.w3schools.com/html/">Visit our HTML tutorial</a> 

Conclusion  

If you already know HTML, then it’ll be easier for you to understand and implement XHTML. Remember, it’s important to keep upgrading yourself from time to time. 

Posted on Jan 19, 2022 by:
Profile image for cindy
cindy
Software Lead Engineer
JavaHTMLSQL.NETXMLVisual Studio

Comments

Profile image for cindy

Software Lead Engineer

JavaHTMLSQL.NETXMLVisual Studio
2.3K
Reputation
139
Following
169
Followers