HTML_CSS::createGroup() creates
basically a group for selectors given as first argument. You can
identify this group by an identifier (alphanumeric) or let HTML_CSS
manage an internal numeric identifier itself.
Let creates this group of selectors :
-
#main p, #main
ul { padding-top: 1em;
color: red;
}
Identify the group yourself
Identifier is named myGroupID in this example:
-
<?php
-
require_once 'HTML/CSS.php';
-
-
$css = new
HTML_CSS();
-
-
$g1 = $css->createGroup('#main p, #main ul', 'myGroupID');
-
$css->setGroupStyle($g1, 'padding-top', '1em');
-
$css->setGroupStyle($g1, 'color', 'red');
-
-
$css->display();
-
?>
Let HTML_CSS do it itself
|
Note
|
|
This is the default behavior.
|
-
<?php
-
require_once 'HTML/CSS.php';
-
-
$css = new
HTML_CSS();
-
-
$g1 = $css->createGroup('#main p, #main ul');
-
$css->setGroupStyle($g1, 'padding-top', '1em');
-
$css->setGroupStyle($g1, 'color', 'red');
-
-
$css->display();
-
?>