PEAR logo

HTML_CSS : The Definitive Guide

Chapter 5. Grouping selectors

Table of Contents

In brief
Create group
Identify the group yourself
Let HTML_CSS do it itself
Handle group selector

In brief

Remember, when several selectors share the same declarations, they may be grouped together to save writing the same rule more than once. Each selector must be separated by a comma.

Two cases exists to handle group of selector. The quick and limited solution (accept only two selectors in a same group) with : HTML_CSS::setSameStyle(). And the extended/common solution with : HTML_CSS::createGroup(), HTML_CSS::setGroupStyle(), HTML_CSS::addGroupSelector() and HTML_CSS::removeGroupSelector().

HTML_CSS : The Definitive Guide v 1.5.0 : January 15, 2008