<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title> Chapter 4. Grouping selectors </title> <link rel="stylesheet" href="book.css" type="text/css" /> <meta name="generator" content="DocBook XSL Stylesheets V1.69.1" /> <link rel="start" href="index.html" title="HTML_CSS Manual" /> <link rel="up" href="pt02.html" title= "Part II. Getting Started" /> <link rel="prev" href="ch03s02.html" title="Basic concepts" /> <link rel="next" href="ch04s02.html" title="Create group" /> <style type="text/css"> /*<![CDATA[*/ body { background-color: white; color: black; } :link { color: #0000FF } :visited { color: #840084 } :active { color: #0000FF } h2.c2 {clear: both} p.c1 {font-weight: bold} /*]]>*/ </style> </head> <body> <table class="htmlcssHeader"> <tr> <td> <img src="img/pearsmall.gif" align="left" alt="PEAR logo" /> <h1> HTML_CSS : The Definitive Guide </h1> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center"> Chapter 4. Grouping selectors </th> </tr> <tr> <td width="20%" align="left"> <a accesskey="p" href="ch03s02.html">Prev</a> </td> <th width="60%" align="center"> Part II. Getting Started </th> <td width="20%" align="right"> <a accesskey="n" href="ch04s02.html">Next</a> </td> </tr> </table> </div><br /> <br /> </td> </tr> </table> <div class="chapter" lang="en" xml:lang="en"> <div class="titlepage"> <h2 class="title"> <a name="developers.group" id= "developers.group"></a>Chapter 4. Grouping selectors </h2> </div> <div class="toc"> <p class="c1"> Table of Contents </p> <dl> <dt> <span class="sect1"><a href="ch04.html#developers.group.purpose">In brief</a></span> </dt> <dt> <span class="sect1"><a href="ch04s02.html">Create group</a></span> </dt> <dd> <dl> <dt> <span class="sect2"><a href="ch04s02.html#id4782312">Identify the group yourself</a></span> </dt> <dt> <span class="sect2"><a href="ch04s02.html#id4782337">Let HTML_CSS do it itself</a></span> </dt> </dl> </dd> <dt> <span class="sect1"><a href="ch04s03.html">Handle group selector</a></span> </dt> </dl> </div> <div class="sect1" lang="en" xml:lang="en"> <div class="titlepage"> <h2 class="title c2"> <a name="developers.group.purpose" id= "developers.group.purpose"></a>In brief </h2> </div> <p> 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. </p> <p> Two cases exists to handle group of selector. The quick and limited solution (accept only two selectors in a same group) with : <code class="methodname">HTML_CSS::setSameStyle()</code>. And the extended/common solution with : <code class= "methodname">HTML_CSS::createGroup()</code>, <code class= "methodname">HTML_CSS::setGroupStyle()</code>, <code class= "methodname">HTML_CSS::addGroupSelector()</code> and <code class= "methodname">HTML_CSS::removeGroupSelector()</code>. </p> </div> </div> <table class="htmlcssFooter"> <tr> <td align="left"> HTML_CSS : The Definitive Guide </td> <td align="right"> v 1.1.3 : February 18, 2007 </td> </tr> </table> <div class="navfooter"> <hr /> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"> <a accesskey="p" href="ch03s02.html">Prev</a> </td> <td width="20%" align="center"> <a accesskey="u" href="pt02.html">Up</a> </td> <td width="40%" align="right"> <a accesskey="n" href="ch04s02.html">Next</a> </td> </tr> <tr> <td width="40%" align="left" valign="top"> Basic concepts </td> <td width="20%" align="center"> <a accesskey="h" href="index.html">Home</a> </td> <td width="40%" align="right" valign="top"> Create group </td> </tr> </table> </div> </body> </html>