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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access