XHTML is a combination of HTML designed to display information and the XML is designed to describe data. XHTML is an extension of HTML, so that the XHTML is very similar to HTML4.01 is supposed to replace HTML. The main reason is lack of good HTML HTML is too flexible, it is possible that incorrect code will appear correctly in a browser, but not on other browsers. At the present time many users who use mobile devices such as mobile phones and PDAs to mengekses website, on this condition, writing HTML code that is less well will affect the page. XHTML can provide solutions to problems like this because XHTML has the order-form (follow the exact syntax) so that XHTML documents can be processed automatically by using a standard XML processors unlike HTML processors that require a fairly difficult and complex. XHTML 1.0 has become rekomendasiWord Wide Web Consortium (W3C) on 26 January 2000.There are three types of XHTML are:
1. Strict, XHTML strict use if you actually use the markup is clean, and have no typos and grammar.
2. Transitional, you can use if you want to take advantage of the transitional method presentation features of HTML and also if the web page would be displayed in a browser that can not parse CSS (cascading styel sheet).
3. Frameset, This is used if you want to display the HTML frames to divide the browser into more than one grame
That must be considered in XHTML are:
1.XHTML is a document that is "well-formed"
All XHTML elements must be arranged in <html> element as root element.
Each element can have sub (child) element. Each sub element should be composed
correctly in the parent element.
With the basic structure:<html>
<head> ... </ head>
<body> ... </ body>
</ Html>
2.Elemen XHTML should be arranged properly (properly nested)
<div> <p> specific text </ div> </ p> ← false<div> <p> specific text </ p> </ div> ← truenote the closing tag, it should <p> closed first, and then close <div> because <p> under <div>
3.Nama tag must be lowercase
<BODY><P> This is a paragraph </ P></ BODY>the above one because the tags use capital letters, should:<body><p> This is a paragraph </ p></ Body>
4.Semua XHTML elements must have a cover
<p> This is a paragraph ← false<p> This is a paragraph </ p> ← true<p> note tag, because it has been dubuka, then <p> tag must be closed with </ p>
5.Penulisan attributes must be in quotes ("")
<table width=100%> ← false<table width="100%"> ← true
6.Penulisan attributes can not be simplified
<input checked> ← false<input checked="checked" /> ← true
Elements that must exist in XHTML are:
1. Doctype declaration
2. Tag <html>
3. Tag <head>
4. <body>
XHTML Example:
<! DOCTYPE HTML PUBLIC "- / / W3C / / DTD XHTML 1.0 Transitional / / EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title> Title </ title>
</ Head>
<body> Page Content
</ Body>
</ Html>
To be able to tell if an XHTML document has been written is valid or not, can use the tools available at http://validator.w3.org/
Sources:http://www.w3schools.com/xhtml/xhtml_html.asphttp://id.wikipedia.org/wiki/Extensible_hypertext_markup_language
Tidak ada komentar:
Posting Komentar