0% completed
Background properties let you style the backdrop of an element. You can use these properties to set a background color, add a background image, and control if and how the image repeats. These tools help you create visually appealing web pages with layered designs.
By using background properties, you can quickly change the look and feel of your page elements without affecting the content.
Follow below syntax to add background properties in CSS code.
/* Set a background color */ background-color: color; /* Set a background image */ background-image: url('path/to/image.jpg'); /* Control background image repetition */ background-repeat: repeat | no-repeat | repeat-x | repeat-y;
Explanation:
In this example, we will style a section of the page by setting a background color and adding an image that does not repeat.
Explanation:
#f0f8ff
.In this example, we will create a design where the background image repeats both horizontally and vertically over a colored background.
Explanation:
#ffe4e1
) as its base.This lesson shows how to use background properties in CSS. You now know how to control the background color, apply an image, and manage its repetition to create balanced and visually appealing web elements.
.....
.....
.....