|
Home >> FAQs/Tutorials >> XHTML Tutorials and Tips >> Index
XHTML Tutorials - Introduction To Tag and Attribute Syntax
By: FYICenter.com
Part:
1
2
3
4
(Continued from previous part...)
What Is Wrong with My <br> Tags?
If you are used HTML syntax, you may write your <br> tags
as in the paragram below:
<p>
I love the way you look at me,<br>
Your eyes so bright and blue.<br>
I love the way you kiss me,<br>
Your lips so soft and smooth.<br>
</p>
But that paragraph will be invalid as XHTML documents, because all 4 <br>
are not closed. You should change it to:
<p>
I love the way you look at me,<br/>
Your eyes so bright and blue.<br/>
I love the way you kiss me,<br/>
Your lips so soft and smooth.<br/>
</p>
What Is Wrong with My <meta> Tags?
If you are converting existing HTML documents to XHTML format,
you may find some <meta> tags are written as:
<meta name="Author" content="FYICenter.com">
<meta name="Description"
content="Tutorials, FAQs and Tips on XHTML Documents.">
<meta name="Keywords"
content="XHTML Tutorials, FAQs, Tips">
But all those <meta> tags are invalid in a XHTML document.
They must be closed as:
<meta name="Author" content="FYICenter.com"/>
<meta name="Description"
content="Tutorials, FAQs and Tips on XHTML Documents."/>
<meta name="Keywords"
content="XHTML Tutorials, FAQs, Tips"/>
Note to HTML document authors: <meta> tag syntax in XHTML is the opposite
to <meta> tag syntax in HTML. In XHTML, meta tag must be closed.
But in HTML, meta tag can not be closed.
How To Enter Element Content?
Most of XHML elements allow you to specify contents. But there
are some XHTML elements that do not allow any contents. If an XHTML element
does allow element content, you need to enter the content between the opening
tag and the closing tag.
Here are some good examples of XHTML elements with contents:
- <title>My First XHTML Document</title>
- <p>A very long paragraph...</p>
- <h1>XHTML Tutorials by FYIcenter.com</h1>
Is XHTML Element Name Case Sensitive?
Yes, XHTML element names are case sensitive. All element names
must be written in lower case letters.
Here are some valid and invalid XHTML element names:
- <html> - Valid name.
- <HTML> - Invalid name, must use lower case letters.
- <xhtml> - Invalid name, not defined by XHTML specification.
- <Body> - Invalid name, must use lower case letters.
Note to HTML document authors: HTML element names are not case sensitive.
But XHTML element names are case sensitive. If you are converting
existing HTML documents to XHTML documents, you will get a lots of syntax errors
about upper case letters used in HTML tags.
(Continued on next part...)
Part:
1
2
3
4
|