Friday, March 26, 2021

CSS Background Image Property

   
CSS Background Image

Background image CSS Property Is used to add the image as the background for the body or any particular section of the web page. And also you can use the background-image to place the image into the particular div, a tag, span tag, etc., If you want to place the icon image at the bottom or in the span you can use this property.

Syntax for body tag

body {
background-image: url (image-file-name. png)
}

If you add the background image for the body tag, it will assign the background for the entire page. The background will appear on the full page.

For tags.

div, a, span {
background-image: url (image-file-name. png)
}

If you assigned the background image for the particular tag like div, a, span, etc. It will appear on that particular section only. How much space that background will occupy on that tag. If you assigned the width 100px and height 50px means it will take the background image for that particular size only.

No comments:

Post a Comment