Fire Studios

Archive

Contact

Categories

  • Coding
    • CSS
    • HTML/Javascript
    • PHP
  • Design
  • Freebies
  • General
  • Internet
  • Interviews
  • Plugins
  • Podcasts
  • Reviews
  • Screencasts
  • Tutorial
  • Weekday Tips
  • Wordpress

Podcast

Weekday Tip: CSS Shorthand pt.2

Weekday Tip: CSS Shorthand pt.2

Background

The background property is a shorthand property for setting all background properties in one declaration. The order of declarations is background-color, background-image, background-repeat, background-attachment, and then background-position. Remember that default values for these properties are not set.

body {background: #[hex-color] url([image URL]) [repeat] [attachment] [position];}
  • Background-color:
    • Color name (black)
    • HEX number (#000000)
    • RGB value (rgb(0,0,0 ))
    • Transparent
  • Background-image:
    • URL
    • None
  • Background-repeat:
    • Repeat-x (horizontally)
    • Repeat-y (vertically)
    • Repeat (both)
    • No-repeat
  • Background-attachment:
    • Fixed
    • Scroll
  • Background-position:
    • top left
    • top center
    • top right
    • center left
    • center center
    • center right
    • bottom left
    • bottom center
    • bottom right
    • X% Y%
    • Xpx/em Ypx/em

Reader's Thoughts

  • Simon

    There is another option for background-color: transparent

  • Fire G

    Yep, forgot to include that one. *added*

Your Thoughts?

 

This is that small text that tells you not to steal our stuff, but we don't really care too much.