Learn HTML
CSS Introduction
CSS Basic Syntax
CSS Selector
CSS Units
CSS Text
CSS Border
CSS Outline
CSS Padding
CSS Margin
CSS Height & Width
CSS Overflow
CSS Resize
CSS Background
CSS Box Sizing
CSS Position
CSS Float
CSS Clear
CSS Clip Path & Shape Outside
CSS Display
CSS Media Queries
CSS Pseudo Classes & Elements
CSS Filter
CSS Transition
CSS Transform
CSS Animation
CSS List Style
CSS Table
CSS Scrollbar Styling
CSS Icon
CSS Cursor
CSS Variable & Calc
CSS User Select
CSS Flexbox
Learn Javascript
Learn Django
For background color we use background-color property.
The background properties:
background-image:url(location/image name.extension);
To give background image this property is used. Pss the url or location
,name and extension of image as value. If image and the html file is in
same location then don't need to give image path.
background-repeat:six predefine values;
This property is used to control the repetition of background image.
The values are:
background-repeat:repeat;
It is the default value. It means we want repetition of the image.
background-repeat:no-repeat;
It means that we don't want repetition of image
background-repeat:repeat-x;
It means that we want repetition of image only in x-axis
background-repeat:repeat-y;
It means that we want repetition of image only in y-axis
background-repeat:space;
It means that we want repetition and also want space between images.
background-repeat:round;
Round property stretches the image;
background-position:predefine values or pixel, percent;
This property is used to set background image position.
The values are:
left top,left center, left bottom, right top, right center,
right bottom, center top, center center,center bottom. x% y%, xpx ypx.
background-attachment: scroll(default) or fixed;
background-attachment:fixed;
It means that when we scroll the page, the background image will not goes up or down. It's position will be
fixed. It won't hide
for scrolling.
background-size:predefine values and pixel or percent;
This property is used to set image background size.
The values are:
background-size:px;
If we pass one value then it will count for both
x and y axis. If we pass two value then first value will
count for x axis(width ) second value is for y axis(height).
background-size:percent;
If we pass one value then it will count for both
x and y axis. If we pass two value then first value will
count for x axis(width ) second value is for y axis(height).
background-size:auto(default);
background-size:cover;
Cover means it will take total height and width of the element.
background-size:contain;
Contain means it tries to take possible maximum height and width
of the element.
background-origin: three predefine values;
This property is used to define that where the background image
position should start start.
The values are:
background-origin:padding-box(default);
background-origin:border-box;
border-box means the background image position
will start form beginning of the box border.
background-origin:content-box;
content-box means the background image position
will start from beginning of the box content.
background-clip:predefine values;
This property is used to define that inside a div or box from where the background color or image
will start. In short we can say that starting position of background color and image inside a box.
background-clip:padding-box;
content-box means the background color position
will start from beginning of the padding.
background-clip:border-box;
content-box means the background color position
will start from beginning of the box content.
background-clip:content-box;
content-box means the background color position
will start form beginning of the box content.
opacity:value 0.0-1.0;
This property is used to give transparent look.
This property is used to give multiple background color.
This property has four values:
background:linear-gradient(value direction name or degree,colors name);
The color effect starts from one side then moves
to other side. We can use degree or direction name like to bottom,
to left, to bottom left, to top right, etc for color effect direction
background:redial-gradient(value direction in degree, colors name);
The color effect starts from center or a particular point. We can use
degree or direction name like to bottom,to left,
to bottom left, to top right etc for color effect direction
background:repeating-linear-gradient(value direction name or degree,colors name);
We can use
degree or direction name like to bottom,to left,
to bottom left, to top right etc for color effect direction.
background:repeating-radical-gradients:(value direction in degree,colors name);
We can use degree for direction .
background-blend-mode:predefine values;
If we have two images or image and color in the background then we can
show various and some beautiful effects with both color and
image.To do this we use background-blend-mode.
The values are:
normal,multiply,scree,overlay,darken,lighten,color-dodge,
color-burn,hard-light,soft-light,difference,exclusion,hue,
color,saturation,luminosity.
mix-blend-mode:predefine values;
The values are:
normal,multiply,screen,overlay,darken,lighten,color-dodge,color-burn,
hard-light,soft-light,difference,exclusion,hue,color,saturation,luminosity.
This property is used to specifies whether the background image should scroll or be fixed.
Value:
background-attachment: fixed;
If you use fixed then the background image will be fixed.
background-attachment: scroll;
If you use scroll then the background image will not fixed.