Nesting TagsNesting is the placing of one set of tags inside another. It typically happens when you want the effect of more than one tag on text or a graphic, etc. For example, sometimes you want text to be bold, italicized and centered. You need different tags for each of these if you are using standard HTML.Many people using HTML have never learned that there is an order to the way these tags are supposed to be used. Here's an example:
Notice that the tags close in the reverse order from the way they open: P, B, I, then /I, /B, /P. That is called nesting. You should always nest tags like this and never cross them like this: P, B, I, then /P, /B, /I. It doesn't matter which tag comes first, ie: which order they appear, but once you choose the order to open them, you need to use the reverse order to close them. Here's a graphic to help show you what I mean:
Tags should be nested like stacked mixing bowls, one pair inside another pair working from the inner to the outer sets. That's the right way to do it. It's alwasy the right time to use good code!
| |