It's true that knowing where the tag should be closed can be a tricky guesstimation at best in many circumstances. There's a simple way to decide where to put the closing tag when in doubt, though: just stick it in the last possible place to have it nest properly. Thus, in your example, the </i> would be placed just before the </b>, like so:
<b>Which <i>exact text was supposed to be italics?</i></b>While this may not give you exactly what the original poster intended, it does help to get your code to validate properly.
|
- apotheon
CopyWrite Chad Perrin |
In reply to Re^2: Ensuring HTML is "balanced"
by apotheon
in thread Ensuring HTML is "balanced"
by skx
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |