HTML_CSS : The Definitive Guide |
A rule or "rule set" is a statement that tells browsers how to render particular elements on an HTML page. A rule set consists of a selector followed by a declaration block.
The HTML_CSS::setStyle()
method is
the only one to handle a declaration block.
For example, to declare a such rule :
You can use more than one declaration within a declaration block. Each declaration must be separated with a semicolon ";".
For example, to declare a such rule :
Or, with whitespace added to aid readability :
HTML_CSS::setStyle()
method call to declare each
declaration block for the same selector.
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. For example :
HTML_CSS::setSameStyle()
, HTML_CSS::createGroup()
and HTML_CSS::setGroupStyle()
.
We should take care than grouping two selectors may be write either
with HTML_CSS::setSameStyle()
or with
couple HTML_CSS::createGroup()
and
HTML_CSS::setGroupStyle()
. When we
have to group three or more selectors, there is only one possibility:
couple HTML_CSS::createGroup()
and
HTML_CSS::setGroupStyle()
.
You can insert comments in CSS to explain your code. Like HTML comments, CSS comments will be ignored by the browser. A CSS comment begins with "/*", and ends with "*/". Comments can appear before or within rule sets as well as across multiple lines.
HTML_CSS 1.0.0 has not yet ability to handle comment such as :
Warning | |
---|---|
The common mistake that people make when writing comments is to expect getting all comments describe with such code below : it's an error. |
You will only get such result:
HTML_Common::setComment()
.
HTML_CSS : The Definitive Guide | v 1.5.0 : January 15, 2008 |