• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 21. Cascading Style Sheets and C... > Background and Color Attributes

Background and Color Attributes

Many style attributes enable you to work with backgrounds and colors, and you’ll find a sample of them in Table 21.3.

Table 21.3. Background and Color Style Attributes
Attribute NS2 NS3 NS4 NS6 IE3a IE3b IE4 IE5 IE5.5 IE6
background   x x x x x x x x
  CSS1: [<background-color> || <background-image> || <background-repeat> || <background-attachment> || <background-position>]
  CSS2: inherit
  Applies to: All elements
  This is a shorthand attribute for setting background properties including background-color, background-image, background-repeat, background-attachment, and background-position at once.
background-attachment    x   x x x x
  CSS1: scroll | fixed
  CSS2: inherit
  Default: scroll
  Applies to: All elements
  Specifies whether a background image is fixed, or scrolls when the user scrolls the rest of the page.
background-color    x x  x x x x
  CSS1: <color> | transparent
  CSS2: inherit
  Default: transparent
  Applies to: All elements
  Indicates the background color of an element.
background-image   x x   x x x x
  CSS1: <uri> | none
  CSS2: inherit
  Default: none
  Applies to: All elements
  Indicates the background image of an element.
background-position    x   x x x x
  CSS1: [ [<percentage> | <length> ]{1,2} | [ [top | center | bottom] || [left | center | right] ] ]
  CSS2: inherit
  Default: 0% 0%
  Applies to: Block-level elements
  Sets the initial position of a background image.
background-repeat   x x   x x x x
  CSS1: repeat | repeat-x | repeat-y | no-repeat
  CSS2: inherit
  Default: repeat
  Applies to: All elements
  Indicates how a background image should be tiled (repeated).
color   x x x x x x x x
  CSS1: <color>
  CSS2: inherit
  Default: Depends on the browser
  Applies to: All elements
  Sets the foreground color of text elements.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint