Book HomeCascading Style Sheets: The Definitive GuideSearch this book Thursday 19th of January 2017 01:54:33 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
LI {margin-top: 10px; margin-bottom: 20px;}H1 {margin-top: 28px;}

Therefore, the last item in the list has a bottom margin of 20pixels, the bottom margin of the UL is 10 pixels,and the top margin of a succeeding H1 is 28pixels. Given all this, once the margins have been collapsed (or, ifyou prefer, overlapped), the distance between the end of theLI and the beginning of the H1is 28 pixels, as shown in Figure 7-17.

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
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.

like Figure 6-57:

BODY {background-image: url(tile1.gif);  background-repeat: repeat;background-attachment: fixed;}H1 {background-image: url(tile2.gif);  background-repeat: repeat;background-attachment: fixed;}
Figure 6-57

Figure 6-57. Perfect alignment of backgrounds

How is this perfect alignment possible? Remember, when a backgroundis fixed , the origin element is positioned withrespect to the canvas. Thus, both background patterns begin tilingyellow border, it's this easy:

As previously discussed, if no colors are defined, then the default color is the foreground color of the element. Thus, the following declaration will be displayed as shown in Figure 7-44:

P.shade1 {border-style: solid; border-width: thick; color: gray;}
P.shade2 {border-style: solid; border-width: thick; color: gray;
border-color: black;}

The result is that the first paragraph has a gray border, having

With all ofthis shorthand stuff, you're probably starting to suspect thatit goes even further, and you're right. We finally come to theshortest shorthand border property of all: border.

This property has the advantage of being very compact, although thatbrevity introduces a few limitations. Before we worry about that,let's see how border is used. If you wantall H1 elements to have a thick, silver border,it's very simple. This declaration would be displayed as shown

XML is derived from SGML, and so was HTML. So in essence, the current infrastructure available today to deal with HTML content can be re-used to work with XML. This is a very big advantage towards delivering XML content using the software and networking infrastructure already in place today. This should be a big plus in considering XML for use in any of your projects, because XML naturally lends itself to being used over the web.

Even if clients don't support XML natively, it is not a big hindrance. In fact, Java with Servlets (on the server side) can convert XML with stylesheets to generate plain HTML that can be displayed in all web browsers.

Using XML to pass parameters and return values on servers makes it very easy to allow these servers to be web-enabled. A thin server side Java layer might be added that interacts with web browsers using HTML and translates the requests and responses from the client into XML, that is then fed into the server.

XML is totally extensible