Quote:
Originally Posted by snakes1100
Quote:
Originally Posted by badheeu
this way is better, without writing banned
<span style="text-decoration: line-through;"/span>
|
Why is that?
1. It don't have a title in it ie. BANNED, without inputing the word BANNED, it will display nothing.
2. The tag is broken, ie. it invalidates the page markup, the page is no longer xhtml compliant as you didnt close the opening or closing span tag.
|
He was trying to write:
Code:
<span style="text-decoration: line-through;" />
Instead of wrapping the span tag around the word banned, you just end it with a "/" symbol to say "only apply it to the word that follows" - but you would still need the word "Banned" after the span tag.
I consider this bad programming practice, for something like a span, or a div - you should really have it wrapped around the text. There's some tags that are okay like that... singular tags like <br /> or <hr /> that don't have closing tags. Or if you have a cell in a table that has no data in it, <td /> is acceptable. But some older browsers don't know what to do with that syntax, so they just apply it to everything until they reach a closing tag. Rare as it may be to see someone using IE4, it happens from time to time.