ad

Showing posts with label background property in css. Show all posts
Showing posts with label background property in css. Show all posts

Sunday, November 13, 2022

CSS Background propertie


 CSS Background propertie



1. Properties

The CSS background properties  use to define the background effect for element. To shorten  code, it  also possible to specify all the background properties in one single property. This is called a shorthand property.

Syntax:

 background Properties :- 

 bg-color and bg-image position/bg-size, bg-repeat, bg-origin bg-clip or bg-attachment initial | inherit;


1) Background  :-   Sets all the background properties in one declaration.

background-colorbackground- image, background-repeat, background-attachment, background-position


2) background- attachment :- Sets whether a background image is fixed or scrolls with the rest of the page. 

scroll, fixed


3) background- color :- The background-color property  specifies the background color of element.

color-rgb, color-hex, color- name, transparent


4) background- image :- 

Sets the background image for the html element. put url(URL) 

5) background- position :-

 Sets the starting position on the background image.

top left, top center, top right, center left, center center, center bottom left, bottom center, bottom right, x% y%, xpos ypos

6) background- repeat :-

    Set  background image will be repeat. the repeat-x, repeat-y, no- repeat