XHTML

XHTML stands for eXtensible HyperText Markup Language. It is markup used to design websites and webpages.

XHTML
XHTML
Filename extension.xhtml, .xht,
.xml, .html, .htm
Internet media typeapplication/xhtml+xml
Developed byWorld Wide Web Consortium
Initial release26 January 2000 (2000-01-26)
Latest release
5.0
(28 October 2014; 11 years ago (2014-10-28))
Type of formatMarkup language
Extended fromXML, HTML
StandardW3C HTML5 (Recommendation)
Open format?Yes

XHTML stands for eXtensible HyperText Markup Language. It is markup used to design websites and webpages.

XHTML is much more strict than ordinary HTML, and is based on both XML and HTML. Due to the lax nature of HTML, different web browsers can sometimes display websites incorrectly since there is more than one way to interpret poorly written HTML. The strict and formal nature of XHTML, once fully adopted will allow for web browsers to display the same page correctly between them. Proper XHTML is also easier to read for humans.

For example, the below code shows one of the differences between HTML and XHTML:

Incorrect, HTML version:

<br>

Correct, XHTML version:

<br />

The line break tag in HTML does not have a closing tag, you just type it once and it creates a line break. In XHTML the rule is that tags that do not have an closing tag must close themselves within the initial tag. These tags are called "empty tags." Another empty tag is <hr /> which inserts a "horizontal rule" or dividing line.

JavaScript Differences

In XHTML, using innerHTML is not "allowed". XHTML also should not be used together with the JavaScript document.write command.


Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.