|
|
In this lesson we will discuss some of the common mistakes in the usage of XHTML:
- Not closing empty elements (elements without closing tags in HTML)
- Incorrect: <br>
- Correct: <br /> or <br></br>
Any of these is acceptable in XHTML: <br></br>, <br/>, and <br />.
- Not closing non-empty elements
- Incorrect: <strong>This text is bold.<p>This text is also bold.
- Correct: <p>This is a paragraph.</p><p>This is another paragraph.</p>
- Improper nesting of tags
- Incorrect: <em><strong>This is some text.</em></strong>
- Correct: <em><strong>This is some text.</strong></em>
- Using attribute values without quotes or wrong quotes
- Incorrect: <td rowspan=3>
- Incorrect: <td rowspan='3">
- Correct: <td rowspan="3">
- Correct: <td rowspan='3'>
- Using the ampersand character outside of entities
- Incorrect: <title>Cars & Trucks</title> (This is also invalid in HTML)
- Correct: <title>Cars & Trucks</title>
Our XHTML Tutorial ends here. How did
you find it? Please let us know at pickatutorial@yahoo.com | Tutorial author: farooq_fl@yahoo.com
More HTML / XHTML Tutorials
|
|