![]() | |
| |
HomeWeb DevelopmentShort ContentsIntroductionCSS Basics Selectors Terminology Media Types Paged Media Aural Media Colours Fonts Text Blocks Lists & counters Tables Miscellaneous Full ContentsIntroductionChanges from CSS1Other CSS sites Download this Guide CSS BasicsSetting StylesUsing external files ...media dependant Setting Style values Comments Inheritance Selectors...by class...by id ...contextual ...all elements ...if a child ...adjacent elements ...by attributes Psuedo Classes ...<A> links :hover :active :focus :lang :firstchild Psuedo Elements ...first line ...first letter ...:before and :after ...inserting content TerminologyCascades"! important" CSS element model Block elements Guide Terminology Units ...lengths ...colours Media Types...giving style...supported types Paged Mediamarginspage size crop marks left, right, first pages page break before page break after page break inside page names orphaned content widowed content Aural Mediavolumespeak pausebefore pauseafter pause cuebefore cueafter cue playduring azimuth elevation speech rate voice family average pitch pitch range stress richness punctuation numbers table headers ColoursForeground colourBackground ...-color ...-image ...-repeat ...-attachment ...-position FontsFont...-family ...-style ...-variant ...-weight ...-size ...-sizeadjust ...-stretch Textword-spacingletter-spacing text-decoration text-shadow vertical-align text-transform text-align text-indent line-height quotes Blocksindividual marginsall margins individual padding all padding border widths all border-widths border-color border-style individual borders all borders width min width max width height min height max height float clear position ...where layered position text direction bidirectional override line height vertical align overflow clipping visibility Lists & counterslist-stylelist-style-type list-style-image list-style-position marker offset resetting counters incrementing counters nesting counters counter appearance displaying counters Tablescaption positionlayout method border display border spacing empty cells MiscellaneousDisplayRun-in boxes whitespace cursors outline outline width outline style outline colour |
Cascades and terminologyCascadesMultiple stylesheets can be merged to create an overall effect, simply by importing more than one:@import url(The effect is called cascading . The style information specified by a document generally overrides any that may have been set by the users. Where style sheets loaded using @import, the last one loaded overrides any settings given to the same properties in the preceding sheets. '@import' must occur at the start of a style sheet.
In general, the cascading order is as follows, with the latter taking precedence of preceding items :
importantformat:selector {
Anything in an author's style sheet that uses the ! important attribute will over ride the user's default sheet, unless the user has also specified ! important for that property. Note that this is slightly different to CSS Level 1example: H1 { color : red ! important}
Formatting model for elementsEach HTML element (<PRE>, etc) is made up of the following, although some may be set to zero:
Block-level elementsThese are elements with a 'display' value of 'block' or 'list-item', as well as floating elements. Block-level elements usually create line breaks at their start and end.Notation for property definitionsIn the sections where I define the various Style properties,
UnitsLength unitsThroughout the definitions, property values are specified as being able to be of type length. These consist of an optional sign character, a number and a two letter unit identifier.relative units are supported as seen in these examples: H1 { margin: 0.5em } /*proportion of the height of the element's font*/ H1 { margin: 1ex } /*proportion of the height of the letter x */ P { font-size: 12px } /*pixels, (dots) on screen or paper */These absolute units are supported: H1 { margin: 0.5in } /*inches, 1in = 2.54cm*/ H2 { line-height: 3cm } /*centimeters*/ H3 { word-spacing: 4mm } /*millimeters*/ H4 { font-size: 12pt } /*points, 1pt = 1/72 in*/ H4 { font-size: 1pc } /*picas, 1pc = 12pt*/ Color unitsColours can be specified as names :aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, and yellow.
...or as RBG (red,green,blue) colours combinations: EM { color: rgb(255,0,0) } /* integer range 0 - 255 */ EM { color: rgb(100%, 0%, 0%) } /* percentage of available values */ EM { color: #rrggbb} /* red,green,blue hexadecimal values */In addition, CSS2 defines the following special colour names, which refer to the respective items in an operating system. They are useful if you want your document to match the user's desktop colour scheme.
(C)opyright, Geoff Knagge.
Continued use of this site indicates your agreement to the Conditions of use and Privacy Policy. |