CSS Backgrounds
The `background-color` property specifies the background color of an element.
CSS background-image
The `background-image` property specifies an image to use as the background of an element.
CSS Background Image Repeat
By default, the `background-image` property repeats an image both horizontally and vertically.
Showing the background image only once is also specified by the `background-repeat`
property:
CSS background-repeat Property
CSS background-attachment Property
The `background-attachment` property specifies whether the background image should scroll or be fixed (will not scroll with the rest of the page):
CSS background-attachment Property
CSS background-position Property
The `background-position` property sets the starting position of a background image.
Note:-
By default, a [background-image`is placed at the top-left corner of an element and repeated both vertically and horizontally.
Property Values of background-position
Example of position center
Example based on horizontal and vertical position
CSS background-size Property
The `background-size` property specifies the size of the background images.
Example of length property
We can also use two images in background.
Example
That's all for the time being.
Please do the following if you enjoyed this thread:
1. Retweet the initial tweet.
2. Follow us and enable notifications:
@codemarch
Also, take a look at our JavaScript Ebook.
JavaScript for Starters: The Complete Guide
➱ JavaScript Roadmap 2022
➱ JavaScript Fundamentals with Exp.
➱ 50+ Programs to practice with Soln.
➱ 50+ Project Ideas
➱ 25+ Projects Code
Grab it NOW.
rli.to/ewVx3