Wednesday 13th of December 2017 08:01:46 PM

[ <length> | <percentage> ]{1,4}


Percentage values refer to the width of the parent element.

As you can see, this property accepts any length value or a percentage. That's all. So if you want all border=0 alt="Book Home" >

Cascading Style Sheets: The Definitive GuideSearch this book

Symbols | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z

Index: A

absolute font sizes: 5.3.1. Absolute Sizes
absolute length units: 3.2.1. Absolute Length Units
absolute positioning: 9.3. Absolute Positioning
absolute URLs: 3.4. URLs
\:active pseudo-class: 2.4.1. Pseudo-Class Selectors
support for: Real-world issues
adjacent-sibling selectors: Adjacent-sibling selector
11.1.3. Case 3: Putting a Magazine Article Online
\:after pseudo-element: Miscellaneous pseudo-elements and pseudo-classes
generated content: 10.4. Generated Content
aligning text: Aligning text
4.1.3. Vertical Alignment
ALINK attribute: 2.4.1. Pseudo-Class Selectors
alternate style sheets: LINK attributes
ancestors: 2.5. Structure
anchors: 2.4.1. Pseudo-Class Selectors
2.4.1. Pseudo-Class Selectors
angle values: 3.5. CSS2 Units
Arabic, text alignment default: Aligning text
asterisk (*) in universal selector: Universal selector
attribute matching: Attribute matching
attribute selectors: 10.2.2. Attribute Selectors
aural media: 1.3.1. Limited Initial Scope
aural style sheets: 10.8.2. The Spoken Word
units for: 3.5. CSS2 Units
auto value, block-level elements: Using auto
automatic numbering: 10.4.1. Automatic Numbering
azimuth property: 10.8.2. The Spoken Word

Symbols | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z

Library Navigation Links

Copyright © 2002 O'Reilly & Associates, Inc. All Rights Reserved.

image (see explanation in Section, "Percentage values" later in this chapter).

For example, we could center it, with the result depicted in Figure 6-36:

BODY {background-image: url(bigyinyang.gif);background-repeat: no-repeat;background-position: center;}
Figure 6-36

Figure 6-36. Centering a single background image

an element from exceeding a certain size, as in this:

max-height: 30em; max-width: 20em;

The question here, though, is what happens if the content of the element doesn't all fit into the specified element size. Does it get cut off at the boundaries, or does it spill outside the positioned element? That's what the next section will explore.

isn't on the list of named colors. This is due to the fact that most web browsers recognize as many as 140 color names, including the standard sixteen. There are two problems associated with using these extra names, though. The first is that not all browsers will recognize them; Opera, for example, sticks with the standard 16 colors, at least in the Opera 3.x series. Far from being a failure on their part, this represents a remarkable commitment to standards support, even though it might confuse or annoy many web designers.

The second problem is a little more fundamental: there are no

This gives us our dark green and dark gray hyperlinks.

Now for headings. They're all supposed to be in a sans seriffont, but H1s have some special rules. In order tocover all the bases in a compact manner, we declare:

H1, H2, H3, H4, H5, H6 {font-family: Verdana,sans-serif;}H1 {color: rgb(0%,40%,0%); border-bottom: thin solid; width: 100%;}

With the second declaration, not only do we use the standard color,but we enhance the idea of "underlining" by setting abottom border that will extend from the left edge of the text all thesafe bet that most people don't. It would make far more senseto specify a single font family for the whole document and thenassign weights to various elements. You can do this, in theory, usingthe various values for the property font-weight. Afairly obvious font-weight declaration is this:

B {font-weight: bold;}

This says, simply, that the B element should bedisplayed using a boldface font; or, to put it another way, a fontthat is heavier than is normal for the document, as shown in Figure 5-8. This is what we're used to, of course,