Social Icons

8 July 2012

0 CSS background property

CSS background properties are used to define the background effects of an html element.
Syntax:
           background-propertyName:value; 

The CSS background properties used to define the background effects are as follows:
  1. background-color
  2. background-image
  3. background-repeat
  4. background-attachment
  5. background-position
1. background-color:value
   To specify the background color of an html element .The value can be a hex value, RGB value or   color name.
  Example:
   background-color:#ddd;
   background-color:rgb(123,145,224);
   background-color:green;

2.background-image:value
  This property is used to specify the background image of an html element.
  Example:
   background-image:url(" url of image");

3.background-repeat:value
  When we set the background image of an element using background-image property, by default, image is repeated both vertically and horizontally and it covers the entire element.To overcome this problem we use background-repeat property.
 Syntax:
  background-repeat:value;
 Value:
  •   no-repeat
  •   repeat
  •   repeat-x
  •   repeat-y
 4.background-attachment:value
    When we set the background image of an element using background-image property,we can specify whether the background scrolls with the page or remains fixed when page is scrolled.
  Syntax:
    background-attachment:value;
 Value:
  •    fixed
  •    scroll
 5.background-position:value;
   To set the position of an element ,we can position the image used as background of that element using this property.
Syntax:
  background-position:value;
Value:
  • top left
  • top center
  • top right
  • center left
  • center center
  • center right 
  • bottom left
  • bottom center
  • bottom right
  • x-% y-%
  • x-pos y-pos

0 comments:

Post a Comment

Hey this is a test comment

Related Posts Plugin for WordPress, Blogger...