I am a beginner in html.
I wanted to make a page in xhtml.
So does changing all characters in html code to lowercase make it Xhtml?

Dani AI

Generated

A short, practical clarification for : lowercasing alone does not make a page XHTML. XHTML is HTML defined as XML, so a document must meet XML well-formedness and follow the XHTML DTD/namespace and stricter syntax rules. was right to say it is not that simple, and was pointing toward the important serving/compatibility issue.

Key items required (quick checklist):

  • Use an XHTML doctype and the XHTML namespace on the root <html> element.
  • Element and attribute names must be lowercase (only one part of the change).
  • Attribute values must be quoted.
  • Empty elements must be self-closed (<br />, <img />, etc.).
  • Boolean attributes must be written out (for example, checked="checked").
  • Elements must be properly nested; ampersands and other special characters must be escaped (&amp;, &lt;).
  • To get true XML parsing you must serve the file as application/xhtml+xml; if served as text/html the browser will use HTML parsing instead. That choice affects compatibility and error handling (an XML parser will stop on well-formedness errors).

Minimal example (XHTML 1.0 style):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <title>Example</title>
  </head>
  <body>
    <p>Text with a line break.<br /></p>
  </body>
</html>

For authoritative syntax and conversion rules see the W3C XHTML specification and validate pages with the W3C Markup Validator. For modern projects, consider HTML5 (simpler doctype and broader compatibility) as an alternative to choosing XHTML.

XHTML 1.0
W3C Markup Validator

Recommended Answers

All 2 Replies

no

Why do you want it in XHTML? It serves no function, as it must be served as HTML or Internet Explorer will not be able to do anything with it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.