Combining SelectorsWhen several selectors share the same declarations, they may be grouped together to prevent the need to write the same rule more than once. Each selector must be separated by a comma. The <h1> and <h2> elements share two declarations, so parts of the two rule sets can be combined to be more efficient as shown in Listing 2.10. Listing 2.10. CSS Code Showing Combined Selectorsh1, h2 { text-align: center; color: navy; } h2 { font-style: italic; } p { color: maroon; } |