XHTML Tutorial #2

Posts 1–6 of 6 · Page 1 of 1
XHTML Tutorial #2
This guide is also completely from w3 schools
XHTML Elements Must Be Properly Nested

In HTML, some elements can be improperly nested within each other, like this:

<b><i>This text is bold and italic</b></i>
In XHTML, all elements must be properly nested within each other, like this:

<b><i>This text is bold and italic</i></b>
Note: A common mistake with nested lists, is to forget that the inside list must be within <li> and </li> tags.

This is wrong:

<ul>
<li>Coffee</li>
<li>Tea
<ul>
<li>Black tea</li>
<li>Green tea</li>
</ul>
<li>Milk</li>
</ul>
This is correct:

<ul>
<li>Coffee</li>
<li>Tea
<ul>
<li>Black tea</li>
<li>Green tea</li>
</ul>
</li>
<li>Milk</li>
</ul>
Notice that we have inserted a </li> tag after the </ul> tag in the "correct" code example.

XHTML Elements Must Always Be Closed

Non-empty elements must have a closing tag.

This is wrong:

<p>This is a paragraph
<p>This is another paragraph
This is correct:

<p>This is a paragraph</p>
<p>This is another paragraph</p>

Empty Elements Must Also Be Closed

Empty elements must also be closed.

This is wrong:

A break: <br>
A horizontal rule: <hr>
An image: <img src="happy.gif" alt="Happy face">
This is correct:

A break: <br />
A horizontal rule: <hr />
An image: <img src="happy.gif" alt="Happy face" />

XHTML Elements Must Be In Lower Case

Tag names and attributes must be in lower case.

This is wrong:

[CODE]]<BODY>
<P>This is a paragraph</P>
</BODY>
This is correct:

<body>
<p>This is a paragraph</p>
</body>[/CODE

XHTML Documents Must Have One Root Element

All XHTML elements must be nested within the <html> root element. Child elements must be in pairs and correctly nested within their parent element.

The basic document structure is:

[HTML]<html>
<head> ... </head>
<body> ... </body>
</html>[/HTML]
Why you copy and paste all from w3school?
Try to write a tutorial by yourself.
Because this is giving more info then a walrus like you could provide... That php tutorial? Fake it had to proper grammar for a walnut like you
Quote Originally Posted by Spookerzz View Post
Because this is giving more info then a walrus like you could provide... That php tutorial? Fake it had to proper grammar for a walnut like you
Google translated everything for me.
Because you're just a big fat noob that does not mean you know HTML!

You really have no understanding of HTML!

Four words:
Stupid, noob, you, suck

If you would ever encounter a real forum specializing in PHP et cetera, would they laugh at you!
Flame war
And next time give credits.
/leecher
Quote Originally Posted by Snape View Post
Flame war
And next time give credits.
/leecher
I did look at the top
Posts 1–6 of 6 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?