Skip to main content

Markup Languages: 3.3. XHTML

Markup Languages
3.3. XHTML
  • Show the following:

    Annotations
    Resources
  • Adjust appearance:

    Font
    Font style
    Color Scheme
    Light
    Dark
    Annotation contrast
    Low
    High
    Margins
  • Search within:
    • Notifications
    • Privacy
  • Project HomeTools and Techniques in Software Engineering
  • Projects
  • Learn more about Manifold

Notes

table of contents
  1. Markup Languages
  2. 1. Grammar of HTML
  3. 2. Organizing HTML
  4. 3. Dialects
    1. 3.1. HTML
    2. 3.2. XML
    3. 3.3. XHTML
  5. 4. Attributes
  6. 5. Semantic HTML
  7. 6. Developing with HTML
  8. 7. Evolution
  9. 8. Bibliography

XHTML

  • HTML has gone through several revisions to add new features and make it more consistent.
  • XHTML is a standardized version of HTML that uses pure XML syntax:
    • Looks just like regular HTML in most respects.
    • All elements must be formally closed (e.g., must specify </p>).
    • Elements must nest hierarchically.
    • All attributes must have explicit values: instead of <select name="state" disabled>, specify <select name="state" disabled="disabled">
  • There is a DTD for XHTML, so you can validate XHTML with any XML validator, such as xmlvalid.

Sample 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"
    xml:lang="en" lang="en">
  <head>
    <title>Hello World</title>
  </head>
  <body>
    <p>
    Hello world!
    </p>
  </body>
</html>

Annotate

Next Chapter
4. Attributes
PreviousNext
Web Technology
Powered by Manifold Scholarship. Learn more at
Opens in new tab or windowmanifoldapp.org