XHTML Guide, Meaning , Facts, Information and Description
Extensible Hypertext Markup Language (XHTML) is a markup language that has the same expressive possibilities as HTML, but a stricter syntax. Whereas HTML was an application of SGML, a very flexible markup language, XHTML is an application of XML, a more restrictive subset of SGML. XHTML 1.0 became a World Wide Web Consortium (W3C) Recommendation on January 26, 2000.
| Table of contents |
|
2 Versions of XHTML 3 Validating XHTML documents 4 See also 5 External links |
XHTML is the successor to, and the current version of, HTML. The need for a more strict version of HTML was felt primarily as now web content needs to be delivered to many devices (like mobile devices) apart from traditional computers, where extra resources cannot be devoted to support the generosities of HTML. (The looser the syntax of a language, the harder it is to process.) A DTD defines the rules of XHTML, against which documents can be checked.
Most of the recent versions of popular web browsers render XHTML properly, and many older browsers will also render XHTML as it is mostly a subset of HTML and most browsers do not require valid HTML. Similarly, almost all web browsers that are compatible with XHTML also render HTML properly. Some say this is slowing the switch from HTML to XHTML.
XHTML's true power is realized when used in conjunction with Cascading Style Sheets. This makes the separation of style and content an integral part of the web page's code.
The changes from HTML to transitional XHTML are minor, and are mainly to increase conformance with XML. The most important change is the requirement that all tagss be well-formed. Additionally, in XHTML, all tags must be written in lowercase. This is in direct contrast to established traditions which began around the time of HTML 2.0, when most people preferred uppercase tags. In XHTML, all attributes, even numerical ones, must be quoted. (This was mandatory in HTML as well, but often ignored.) All elements must also be closed, including empty elements such as
Wikipedia pages currently use valid XHTML 1.0 Transitional.
XHTML is HTML reformulated as XML. There are three different versions, equal in scope to their respective HTML4.0 versions.
For a document to validate, it must contain a Document Type Declaration. A DTD should be placed at the very beginning of an XHTML document. These are the most common XHTML DTDs:
;XHTML 1.0 Strict
Some of the most common errors in XHTML are:
When a page is validated using the W3C Markup Validation Service, the W3C returns a small icon that you may place on your document to show that it conforms to web standards. The W3C also offers validation for CSS and HTML documents.
This is an Article on XHTML. Page Contains Information, Facts Details or Explanation Guide About XHTML Overview
img and br. This can be done by adding a closing slash to the start tag: <img … /> and <br />. Attribute minimization (e.g., <option selected>) is also prohibited. More differences are detailed at the W3C XHTML specification.Versions of XHTML
Work on XHTML 2.0 is, as of 2004, still underway. The XHTML 2.0 draft is controversial because it breaks backwards compatibility with all previous versions, and is therefore in effect a new markup language inspired by [X]HTML rather than a true successor of it.Validating XHTML documents
An XHTML document that conforms to the XHTML specification is said to be a valid document. In a perfect world, all browsers would follow the web standards and valid documents would predictably render on every browser and platform. Although validating your XHTML does not ensure cross-browser compatibility, it is recommended. A document can be checked for validity at the W3C Markup Validation Service ([1]).
;XHTML 1.0 Transitional
;XHTML 1.0 Frameset
;XHTML 1.1
A character encoding should also be specified at the beginning of an XHTML document. Once an XHTML document has a doctype and character encoding specified, it can be run through a validator (such as the W3C Markup Validation Service) to see if it meets the standard. Validation will locate and describe errors in XHTML markup.
This is not an exhaustive list, but gives a general sense of errors that XHTML coders often make.alt attribute, which helps make pages accessible for devices that don't load images or screen-readers for the blind)
See also
External links
