CSS Background

What Does CSS Background ?

Background property is to create the background effect on an HTML element.

CSS properties used for background effects: background-color, background-image, background-repeat,background-attachment, background-position.

There are several kinds of properties on the following background,

Look Examples in below:

  • Background Color, is to set the background of an element with a solid color.
    Example:

h1 {
   background-color:#FFFFFF;
   }
  • Background Image, is to set the background of an element with the image.
    Example:
h1 {
   background-image: url(nama-gambar.gif);
   }
  • Background Repeat, is to set the background of an element with an image that can be repeated or not.
    Example:
h1 {
   background-image: url(your-Picture.gif);
   background-repeat: no-repeat;
   }

other than no-repeat also, the value can be inherit, repeat, repeat-x and repeat-y.
Try one by one to see the effect happen!.

  • Background Attachment, is to set the background of an element with a picture, if can be scroll or not.
    Example:
h1 {
   background-image: url(nama-gambar.gif);
   background-attachment: fixed;
   }

Other than fixed also, the value can be inherit and scroll
Try one by one to see the effect happen!.

  • Background Position, is to set the location / position of a background picture element.
    Example:
h1 {
   background-image: url(nama-gambar.gif);
   background-repeat: no-repeat;
   background-position: top;
   }

Other than top also, the value can be inherit, center, left, right, and bottom
Try one by one to see the effect happen!.

  • Background,is to declare all the background properties into one. This method most widely used by web designers because it can shorten your work time.
    Example:
h1 {
   background:#FFFFFF url(nama-gambar.gif) no-repeat left top;
   }
  • Welcome to CSS Syntax [dot] com
    Welcome to our Website ... CSS Syntax com is a website that explains about anything related to web...
    www.csssyntax.com
  • CSS 3 Background Color Opacity
    Everyone knows what RGB stands for (red, green, blue), but what does the A stand for?
    www.csssyntax.com
  • CSS 3 Text Shadow
    Using CSS3, we can create shadow effects on text with very simple syntax
    www.csssyntax.com
  • CSS 3 Box Shadow
    Excess CSS3 is able to make something that can not be done by CSS2
    www.csssyntax.com