CSS Tutorial

The language for styling web pages.

CSS Backgrounds

CSS Backgrounds

The CSS background properties are used to add background effects for elements.

Background Properties:

  • background-color - Sets background color
  • background-image - Sets background image
  • background-repeat - no-repeat / repeat-x / repeat-y
  • background-position - center / top / bottom etc.
  • background-size - cover / contain / px
  • background-attachment - fixed / scroll
  • background - Shorthand for all

Try It Yourself

Edit the code below and click Run to see the result live.

Source Code
Result
Topics