Prev | Current Page 456 | Next

Tommy Olsson and Paul O'Brien

"The Ultimate CSS Reference"


Using this shorthand property, we can
set the color of the background (the
background-color), and supply the URI of an image to be used on the background
at the same time. The remaining properties dictate how and where the image is
placed.
Example
This style rule simultaneously assigns
values to all the individual background
properties of the element with ID
"example":
#example{
background: #fff url(image.gif)
??? no-repeat fixed left top;
}
As with other shorthand properties, any values that aren??™t specified will be set to
their defaults. This has implications if, for instance, the background-color is defined
as follows:
#example{
background: red;
}
In the above example, all the omitted values will be set to their default states??”for
background-image, the default is none. If the element already had a background
image defined, that specification would be negated, and no image would appear.
Therefore, when you??™re using the shorthand property, take care to ensure that no
conflicts exist.


Pages:
444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468