extensile HyperText Markup Language, or even XHTML, occurs as markup language that hwhen the equivalent expressive possibilities as HTML, but the nonindulgent syntax. Whereas HTML is an application of SGML, a super flexible markup language, XHTML is an application of XML, a supplementary restrictive subset of SGML. Because it want to become easily-grammatical (syntactically right), XHTML documents provide machine-controlled processing to become performed applying the standard XML library — unlike HTML, which takes the comparatively complex, lenient, & usually customised parser (though an SGML parser library can even become utilized). XHTML One.Cipher became the World Wide Web Consortium (W3C) Recommendation on January 26, 2000.
Overview
XHTML is the successor to HTML. In and of itself, XHTML can become considered by several to be a "current version" of HTML, however these are a separate, parallel standard; a W3C continues to recommend the apply of either XHTML One.Ace, XHTML One.Cipher, or even HTML Four.01 for web publication.
the want for a supplementary nonindulgent version of HTML was felt primarily because World Wide Web content now needs to exist as delivered to numbers of hardware (prefer mobile devices) apart from traditional computers, where more resources can't become devoted to trend lines a extra complexness of HTML syntax.
Virtually all of the recent versions of popular web browsers render XHTML properly, & numerous older browsers may when well render XHTML as these are mostly compatible by using HTML and virtually all browsers don't need valid HTML. Likewise, everthing but all web browsers that come compatible by having XHTML too render HTML properly. Occasionally argue this compatibility is slowing a switch from either HTML to XHTML.
An especially utile feature of XHTML is that different XML namespaces (such as MathML and Scalable Vector Graphics) can be incorporated in it.
A changes from either HTML to XHTML come minor, & come primarily to achieve conformity using XML. A first vary is a requirement that the document must exist as well formed and all elements must be closed. inside addition, inside XHTML, completely tags must become written in lowercase. This is inside contrast to established traditions which began around a period of HTML Two.Nought, after virtually all population favorite uppercase tags. Around XHTML, tons attribute values must become enclosed by quotes. (This is optional inside SGML, & hence around HTML, around which quotes can be omitted in occasionally circumstances.) Tons elements must too become explicitly closed, including empty elements like img & br. This may be handle adding the closing slash to the begin tag: and . Attribute minimisation (e.g., ) is too prohibited; instead, utilise . Additional differences come detailed in the W3C XHTML specification [http://www.w3.org/TR/xhtml1/#diffs].
Versions of XHTML XHTML 1.0
A original XHTML W3C Recommendation, XHTML One.Cypher, was just the reformulation of HTML Four.01 around XML. There are leash different 'flavors' of XHTML One.Zero, apiece equal around scope to their several HTML Four.01 versions.
XHTML One.Nought Strict is the equivalent when HTML Four.01 Strict, however follows XML syntax system.
XHTML One.Zero Transitional allows a select few green deprecated elements & attributes non discovered inside XHTML One.Cypher Strict to become utilized, like
, , , & .
XHTML One.Nought Frameset: Allows a have of HTML framesets.
XHTML 1.1
A virtually all recent XHTML W3C Recommendation is XHTML One.I: Module-depending XHTML. Authors potty import extra features (like framesets) into their markup. This version too leave ruby markup support, required for East-Asian languages (especially CJK).
The XHTML 2.0 draft specification
Act in XHTML Two.Cypher is, as of 2005, still afoot; as a matter of fact, a DTD has non possibly been authored however. A XHTML Two.Zero draft is controversial because it breaks backwards compatibility by using completely former versions, & is so effectively the freshly markup language created to circumvent (Ten)HTML's limitations like than existence only the fresh version.
Newly features brought into a HTML personal of markup languages by XHTML 2.Cipher:
HTML forms is replaced by XForms.
HTML frames is replaced by XFrames.
A DOM Events will be replaced by XML Events, which uses a XML Document Object Model.
a newly names element nature and severity, the element nature and severity, is involved sequentially to specifically designate the names as a navigation listing. This is utile around creating nested menus which are then presently created by the wide kind of means.
Any element is entity to work as a hyperlink, e.g.,
Articles
.
Any element is suspire to information guide media by having a src attribute, e.g.,
London Bridge
might replenish .
A element has been flushed pro A running elements (we.e. , , , etc.) is deprecated in favor of the individual element . Levels of headings might instead exist as indicated per nested elements both by having their have running.
A presentational elements , & , however allowed around XHTML One.x (potentially Strict), is scatty from either XHTML Two.Cypher. A exclusively presentational elements remaining is & for superior & inferior severally.
Others in the XHTML family XHTML Basic: A favorite "light" versiin of XHTML for hardware which just can't have a to the full XHTML placed, primarily utilized on handhelds like mobile phones. This is the designed replacement for WML and C-HTML.
XHTML Mobile Profile: Based on XHTML Basic, this OMA ([http://www.openmobilealliance.org/ Open Mobile Alliance]) effort targets hand phones specifically by adding mobile phone-specific elements to XHTML Basic.
Validating XHTML documents
An XHTML document that conforms to the XHTML specification is said to exist as the valid document. Around a hone globe, completely browsers would watch the web standards & valid documents would predictably render in each web browser & platform. Although validating the XHTML doesn't assure cross-web browser compatibility, it is recommended. a document may be checked for validity by owning the W3C Markup Validation Service.
DOCTYPEs
For the document to validate, it must contain the Document Type Declaration, or DOCTYPE. The DOCTYPE declares to the web browser what Document Type Definition (DTD) the document conforms to. a Document Nature and severity Declaration should become set at the super beginning of an XHTML document. Which are actually a usual XHTML Document Nature and severity Declarations:
;XHTML Unity.Nought Strict
;XHTML Ace.Cipher Transitional
;XHTML Unity.Cipher Frameset
;XHTML One.1
A system identifier, which in these examples is the URL that begins with "http", require just point to a copy of a DTD to utilise in case the validator just can't retain a single according to the public identifier (the more quoted string). It doesn't want to become a specific Address that is within these examples; as a matter of fact, authors come encouraged to have local copies of the DTD files whilst conceivable. A public identifier, notwithstanding, must become character-for-character a equivalent when in the examples.
Character encoding may be specified at the beginning of an XHTML document in the XML declaration & in the meta http-equiv element. (In case an XML document lacks encryption specification, an XML parser assumes that the encryption is UTF-8 or even UTF-16, unless a encoding has already been determined by a higher protocol.)
Common errors
Occasionally of the usual errors inside XHTML come:
Not closing empty elements (elements forgoing closing tags)
Incorrect: Correct: Not closing non-empty elements
Incorrect:
This occurs as paragraph.
This is an additional paragraph.
Correct:
This occurs as paragraph.
This is a second paragraph.
Improperly incubation elements (elements must exist as closed around reverse choose)
Incorrect: This is a bit of text.Correct: This is occasionally text.Not specifying alternate text for images (using the alt attribute, which aids produce web sites accessible for gear that don't batch images or even screen-readers for the blind)
Incorrect: Correct: Putting text directly inside a body of the document (this is non an error in XHTML One.Nought Transitional)
Incorrect: Welcome to our report.Correct:
Welcome to the report.
Nesting prevent-level elements inside inline elements
Incorrect:
Introduction
Correct:
Introduction
Not putting quotation marks in the area of attribute values
Incorrect:
Correct:
Using a ampersand outside of able (apply & to display a ampersand character)
Incorrect: Cars & TrucksCorrect: Cars & TrucksUsing uppercase tag list and/or tag attributes
Incorrect:
A Better Document Ever
Correct:
A Better Web page Ever
Attribute minimization
Incorrect: Correct:
This is non an thorough listings, however gives the general feel of errors that XHTML coders typically produce.
Backward compatibilities
XHTML One.Cypher documents come mostly feebleminded compatible sustaining HTML — that is, processable whilst HTML by the browser that doesn't understand training properly manage XHTML — when authored based on data from certain guidelines given in the specification & served when text/html like than a extra appropriate application/xhtml+xml. Authors world health organization watch a compatibility guidelines in essence produce HTML that, patch technically invalid due to the utilize of ill-shapen empty-element tags, happens to become processable by tons modern web browsers, which are then super lenient once reading "tag soup".
XHTML One.Unity's modularity features cease it from either existence feebleminded compatible using XHTML One.Zero & HTML. XHTML Two.Nought, also, is non feebleminded compatible sustaining its predecessors.
Example
A as a result is an case of XHTML One.Cypher Strict.
XHTML Example
This occurs as lilliputian lesson of an XHTML document.
W3C HTML Home Page
The W3C's HTML website, including information about HTML and XHTML.
XHTML: Where XML and HTML meet
Discussion of XHTML 1.0 and how it improves on the HTML 4.0 standard. Examines the issues involved in the transition between HTML and XHTML. Also explores backwards compatibility to HTML and XHTML modularization.
NYPL Styleguide
XHTML 1.0 overview. Includes discussion of accessibility and document validation. Also XHTML authoring tips and tools featuring the use of Dreamweaver.