• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Nesting Tags

In some cases, you may want to modify your page contents with more than one tag. For example, you may want to add italic formatting to a word inside a header. There are two things to keep in mind here. First, not all tags can contain all other kinds of tags. As a general rule, those tags that affect entire paragraphs (the W3C calls thisblock-level) can contain tags that affect individual words or letters (inline), but not vice versa.

Second, order is everything. Whenever you use a closing tag it should correspond to the last unclosed opening tag. In other words, first A then B, then /B, and then /A (Figure 1.5).


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint