Creating Styles for Nested Tags

There can be times when you want a specific formatting to be applied when one tag is nested within another. For example, perhaps you want a bulleted list that’s nested within another bulleted list to use a different bullet character.

If you simply created a rule for the entire tag, all text that used it would be formatted the same way. For example, if you created a style for the <ul> tag, all bulleted items would use the same bullet character. Instead, you must specify that you want to apply a rule only to the nested tag. To do this, instead of using a single style name at the beginning of the rule, specify that the item is nested by listing the parent style name followed by the descendent (child) style name. For ...

Get HTML and XHTML Step by Step now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.