Book HomeCascading Style Sheets: The Definitive GuideSearch this book Thursday 31st of July 2014 09:34:20 PM

10.9. Summary

CSS2 obviously covers a lot of ground, and exploring it in detail would probably have added at least four more chapters to this book, not to mention dramatically bulking up some of the chapters that already exist. However, since so little of CSS2 has actually been implemented at this writing, we felt it was better to provide an overview that was light on details. After all, the specification may change as implementations reveal flaws, and we'd rather stick to describing things that are fairly reliable.

For quick reference purposes, Table 10-1 gives a quick summary of everything new in CSS2.

Table 10-1. New Properties in CSS2

New Properties in CSS2

text-shadow
font-size-
adjust
font-stretch
unicode-bidi
cursor
outline
outline-color
outline-style
outline-width
content
quotes
counter-reset
counter-increment
marker-offset
border-top-color
border-right-color
border-bottom-color
border-left-color
border-top-style
border-right-style
border-bottom-style
border-left-style
position
direction
top
right
bottom
left
z-index
min-width
max-width
min-height
max-height
overflow
clip
visibility
page-break-before
page-break-after
page-break-inside
orphans
widows
size
marks
border-collapse
border-spacing
table-layout
border-spacing
empty-cells
caption-side
speak-header-cell
volume
speak
pause-before
pause-after
pause
cue-before
cue-after
cue
play-during
azimuth
elevation
speech-rate
voice-family
pitch
pitch-range
stress
richness
speak-punctuation
speak-rate
speak-numeral
speak-time

New Pseudo-Classes and Pseudo-Elements in CSS2

:hover
:left
:right
:first
:before
:after

New @-rules in CSS2

@media
@font-face
@page

Table 10-2. New Values in CSS2

All Properties

inherit

The display Property

run-in
compact
marker
table
inline-table
table-row-group
table-column-group
table-header-group
table-footer-group
table-row
table-cell
table-caption 

The font Property

caption
icon
menu
message-box
small-caption
status-bar

The list-style-type Property

decimal-leading-zero
hebrew
georgian
armenian
cjk-ideographic
hiragana
katakana
hiragana-iroha
katakana-iroha
lower-greek

The color values

active-border
active-caption
app-workspace
background
button-face
button-highlight
button-text
caption-text
gray-text
highlight
highlight-text
inactive-border
inactive-caption
info-background
info-text
menu
menu-text
scrollbar
IMG elements with a BORDER attribute, or all elements that have a class of some type:

A[name] {color: purple;}      /* colors any NAME anchor purple */
IMG[border] {border-color: blue;}  /* sets blue border for any bordered IMG */
[class] {color: red;}        /* sets any classed element red */

In none of these situations does it matter what value is assigned to the attributes of each element. As long as the given attribute is present for the element, the element will match the selector shown. Thus, in the following example, the first two IMG

three-d-dark-shadow
three-d-face
three-d-highlight
three-d-lightshadow
three-d-shadow
window
window-frame
window-text

The vertical-align Property

length 


Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.

for a single element, you'll need to use some of the other border properties. Of course, it's possible to turn the cascade to your advantage:

H1 {border: thick silver solid;
border-left-width: 20px;}

The second rule overrides the width value for the left border assigned by the first rule, thus replacing thick with 20px , as we see in Figure 7-50.

For example, to float an image to the right, you could use thismarkup:

<IMG SRC="b5.gif" style="float: right;" alt="section b5">

As Figure 7-63 makes clear, the image "floats" tothe right side of the browser window. This is just what we expect.However, some interesting issues are raised in the course of floatingelements in CSS.

Navigator handles any one of these options; Explorer can handleall three.Here's a link to the <A HREF="#top">top of 
this page.</A>  (I stuck a hidden anchor tag there:&lt;ANAME="top"&gt; &lt;/a&gt;)
Use anchors to improve navigability, but remember that multiplelinked pages will download quicker than one huge page requiring lots of padding. As we discussed before, it also extends to the outer edge ofthe border, but the background has to go through the padding beforeit even gets to the border.

The default value of padding is0 (zero), and padding values cannot be negative.

WARNING

Opera 3.5 allows negative paddingvalues, but this was fixed in Opera 3.6.