[XHTML Tutorial] to XHTML standards (4) (XHTML Syntax)
Related Tags:
Translation: Fanweixiao
Writing XHTML demands a clean html syntax.
We need a clean Syntax to write HTML pages XHTML
Some More XHTML Syntax Rules:
More XHTML syntax:
Attribute Names Must Be In Lower Case
Attribute names must use lowercase
This is wrong:
Error code:
<table WIDTH="100%">
This is correct:
Correct code:
<table Width="100%">
Attribute values Must Be Quoted
Attribute value must quote
This is wrong:
Error code:
<table Width=100%>
This is correct:
Correct code:
<table Width="100%">
Attribute Minimization Is Forbidden
Attributes abbreviated method is prohibited
This is wrong:
<dl Compact>
<input Checked>
<input Readonly>
<input Disabled>
<option Selected>
<frame Noresize>
This is correct:
<dl Compact="compact">
<input Checked="checked" />
<input Readonly="readonly" />
<input Disabled="disabled" />
<option Selected="selected" />
<frame Noresize="noresize" />
Here is a list of the minimized attributes in HTML and how they should be written in XHTML:
In HTML abbreviated attributes and its XHTML in writing a list of what it should:
HTML XHTML
Compact compact = "compact"
Checked checked = "checked"
Declare declare = "declare"
Readonly readonly = "readonly"
Disabled disabled = "disabled"
Selected selected = "selected"
Defer defer = "defer"
Ismap ismap = "ismap"
Nohref nohref = "nohref"
Noshade noshade = "noshade"
Nowrap nowrap = "nowrap"
Multiple multiple = "multiple"
Noresize noresize = "noresize"
The id Attribute Replaces The name Attribute
Id attribute to the use of alternative name attribute
HTML 4.01 defines a name attribute for the elements a, applet, frame, iframe, img, and map. In XHTML the name attribute is deprecated. Use id instead.
For a, applet, frame, iframe, and map img, HTML 4.01 in the definition of a name attribute in XHTML is not in favour of doing so, to replace the use of id name.
This is wrong:
<img Src="picture.gif" name="picture1" />
This is correct:
<img Src="picture.gif" id="picture1" />
Note: To interoperate with older browsers for a while, you should use both name and id, with identical attribute values, like this:
Note: To version of the browser relatively low presence, you should also use name and id attributes, and they should be the value of the two is the same, like this:
<img Src="picture.gif" id="picture1" name="picture1" />
The Lang Attribute
Lang attributes
The lang attribute applies to almost every XHTML element. It specifies the language of the content within an element.
Lang attributes can be applied to almost all of XHTML elements. It designated elements of the contents of the language set.
If you use the lang attribute in an element, you must add the xml: lang attribute, like this:
If you like an Element in the application lang attributes, you must add xml: lang attribute, like this:
<div Lang="no" xml:lang="no"> Heia Norge! </ Div>
Mandatory XHTML Elements
Mandatory elements of XHTML
All XHTML documents must have a DOCTYPE declaration. The html, head and body elements must be present, and the title must be present inside the head element.
All XHTML documents must have a DOCTYPE reputation. Html, head and body elements must appear, and title must appear in the head,
This is a minimum XHTML document template:
This is one of the least of XHTML document templates
<! DOCTYPE Doctype goes here>
<html Xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> Title goes here </ title>
</ Head> <body>
Body text goes here
</ Body> </ html>
Note: The DOCTYPE declaration is not a part of the XHTML document itself. It is not an XHTML element, and it should not have a closing tag.
NOTE: DOCTYPE statement is not part of their XHTML documents. It is not XHTML elements, it has not closed at.
Note: The xmlns attribute inside the <html> tag is required in XHTML. However, the validator on w3.org does not complain when this attribute is missing in an XHTML document. This is because "xmlns = http://www.w3 .org/1999/xhtml "is a fixed value and will be added to the <html> tag even if you do not include it.
NOTE: XHTML files of the xmlns attribute appear in the html tags. However, the effectiveness of inspection w3.org will not be on this property does not appear in your XHTML documents and reports errors. This is because "xmlns = http://www.w3.org/1999/xhtml" is a fixed value, even if your file does not contain it, it will be automatically added.
You will learn more about the XHTML document type definition in the next chapter.
In the next chapter of the study, you will learn more XHTL document type definition of knowledge.
(Reproduced Please specify the source)
- XHTML
- On the XHTML CSS
- Css & Web standards xhtml
- Xhtml + css Guide
- Use the advantages of xhtml + css
- XHTML + CSS compatibility solutions
- Web standards: XHTML + CSS (W3C)
- JS + CSS + XHTML ? ?
- Web standards beginner: CSS and XHTML
- XHTML CSS style into what?
- XHTML + CSS accumulation of 1
- Xhtml + CSS on the web standards
- Domestic xhtml + css website
- Css information xhtml +
- XHTML + CSS = Reconstruction Site
- Http://www.w3cpro.cn/xhtml/index.html the css
- XHTML CSS = Reconstruction Site
- XHTML + CSS: Call Style Sheets
- PhotoShop with two minutes to complete a xhtml + css Home
- Two minutes to be a xhtml + css the Home




