CSS - Background

CSS - background properties are used to specify the background effects of the element. 
  • background-color
    This property specify the background color of the element.
    Ex:
    body{
    background-color : yellow;
    }

  • background-image
    This property specify an image to use as background of the element. By default image is repeated to cover the whole document.
    Ex:
    body{
    background-image : url(background.jpg);
    }

  • background-position
    This property specify the position of the background image of the element.
    Ex:
    body{
    background-position: right top;
    }

  • background-repeat
    By default images are repeated both vertically & horizontally. This property specify the background color of the element.
    Ex:
    body{
    background-repeat : repeat-x; // repeated horizontally
    }

    p{
    background-repeat : repeat-y; // repeated vertically
    }

No comments:

Post a Comment