void|PEAR_Error HTML_CSS::addGroupSelector (
mixed $group
, string $selectors
)
Add a selector to a CSS definition group
$group
CSS definition group identifier
$selectors
Selector(s) to be defined, comma delimited.
throws HTML_CSS_ERROR_NO_GROUP, HTML_CSS_ERROR_INVALID_INPUT
since version 0.3.0 (2003-11-03)
This function can not be called statically.
<?php
require_once 'HTML/CSS.php';
$css = new HTML_CSS();
// define styles
$g = $css->createGroup('body, html');
$css->setGroupStyle($g, 'margin', '2px');
$css->setGroupStyle($g, 'padding', '0');
$css->setGroupStyle($g, 'border', '0');
// display intermediate result
echo $css->toString();
// will output:
/*
body, html {
margin: 2px;
padding: 0;
border: 0;
}
*/
// did not reflect a real usage, it's only a study case purpose
$css->removeGroupSelector($g, 'body');
$css->addGroupSelector($g, '.large');
$css->setGroupStyle($g, 'border', 'solid thin');
// display final result
echo $css->toString();
// will output:
/*
html, .large {
margin: 2px;
padding: 0;
border: solid thin;
}*/
?>