Advanced CSS: Beyond Simple Classes: Katya Sadovsky Katya@uci - Edu
Advanced CSS: Beyond Simple Classes: Katya Sadovsky Katya@uci - Edu
Katya Sadovsky
[email protected]
S* = [ \t\r\n\f]+
declaration = property ':' S* value;
Example: selector
.uportal-text-small { declaration
color : Black;
font-family : Verdana, Geneva, Arial, Helvetica;
font-size : 10px; }
property
E[foo] Attribute selector: matches any E element with the "foo" attribute set (whatever the value).
E[foo="warning"] Attribute selector: matches any E element whose "foo" attribute value is exactly equal to "warning".
Attribute selector: matches any E element whose "foo" attribute value is a list of space-separated
E[foo~="warning"]
values, one of which is exactly equal to "warning".
Attribute selector: matches any E element whose "lang" attribute has a hyphen-separated list of
E[lang|="en"]
values beginning (from the left) with "en“ (e.g. en-US).
E:first-child Pseudo-class selector: matches element E when E is the first child of its parent.
Pseudo-class selector: matches element E if E is the source anchor of a hyperlink of which the target
E:link, E:visited
is not yet visited (:link) or already visited (:visited).
E:active, E:hover, E:focus Dynamic Pseudo-class selector: matches E during certain user actions.
E:first-line, E:first-letter Pseudo-element selector: matches the first formatted line or letter of element E.
STYLE attribute
overrides
<STYLE> block
overrides
Linked stylesheet
overrides
Imported stylesheet
padding
content
border
– Firefox:
div.main:after {
content: "";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
• CSS resources:
– http://www.w3.org/TR/REC-CSS2/
– http://www.yourhtmlsource.com/stylesheets
– http://meyerweb.com/eric/css/
– http://webtips.dantobias.com/logical.html
– http://www.bigbaer.com/css_tutorials/css.float.html.tutorial.htm
– http://www.w3.org/2005/Talks/11-steven-css-advanced/
– http://www.hicksdesign.co.uk/journal/3d-css-box-model
– http://greystate.dk/resources/css-boxmodel/
– http://www.csszengarden.com/?cssfile=062/062.css