Home Python C Language C ++ HTML 5 CSS Javascript Java Kotlin SQL DJango Bootstrap React.js R C# PHP ASP.Net Numpy Dart Pandas Digital Marketing

vs.XHTML:

XHTML (Extensible Hypertext Markup Language) is a stricter and more XML-compliant version of HTML. It adheres to the syntax rules of XML and has some additional requirements compared to HTML. Here's a basic comparison between HTML and XHTML tags:


HTML

XHTML:

Here's an example of a simple HTML document:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>HTML Example</title>
</head>
<body>
<h1>Hello, HTML!</h1>
<p>This is an example of HTML.</p>
</body>
</html>


And here's the same document written in XHTML:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8" />
<title>XHTML Example</title>
</head>
<body>
<h1>Hello, XHTML!</h1>
<p>This is an example of XHTML.</p>
</body>
</html>


In summary, while HTML is more lenient and forgiving, XHTML imposes stricter rules to ensure well-formed documents that are more compatible with XML tools and technologies.




Advertisement





Q3 Schools : India


Online Complier

HTML 5

Python

java

C++

C

JavaScript

Website Development

HTML

CSS

JavaScript

Python

SQL

Campus Learning

C

C#

java