ankitweblogic logo
W e b t u t o r i a l s

Define CSS

CSS Comment

CSS Selectors

Types of CSS

CSS Color Property

CSS Font Property

CSS Background

CSS Box Model

CSS3 Border Radius

Styling HTML Table

Styling Links

CSS Menu

Display, Visibility

CSS Overflow Property

CSS Position, Z-index

CSS Outline, Offset

CSS Cursor Property

CSS3 box-sizing

CSS Web Layout

CSS Website

Google Fonts

Google Map

Login Form

Google Page

Facebook Page

CSS Assignment List

CSS Background Property

CSS Background property is use to apply background color or background image on HTML element. By default, the image is repeated both horizontally and vertically.

Property Description
background-color Specify the background color to be used.
background-image Specify the background image to be used.
background-repeat Specifies how to repeat the background images.
background-position Specifies the position of the background images.
background-attachment Specifies whether the background images are fixed or scrolls.

CSS background-color

The background-color property is use to apply background color of any HTML element. Ver CSS1.

Example 1: Change the document, h1, p background color


CSS background-image

The background-image property is use to apply image in the background of any HTML element. Ver CSS1.

By default, a background-image is placed on the top-left corner of any element, and repeated both vertically and horizontally.

background-position: 30% 20%;
background-position: 50px 100px;
background-position: left top| left center| left bottom| right top| right center| right bottom| center top| center center| center bottom
background-repeat:repeat | no-repeat | repeat-x | repeat-y
background-attachment:fixed | scroll