css background-image attribute sets the background image for the element. The syntax is: background-image:url (image path). The background image you set takes up the full size of the element, including padding and borders, but not margins.
#How to use the css background-image property?
Function: Set the background image for the element.
Note: The background of an element occupies the entire size of the element, including padding and borders, but not including margins. By default, the background image is placed in the upper left corner of the element and repeats horizontally and vertically.
Note: The attribute value "inherit" is not supported in any version of Internet Explorer (including IE8).
css background-image property usage example
<html> <head> <style type="text/css"> body {background-image:url('https://img.php.cn/upload/article/000/005/656/5af270fd37755429.jpg');} </style> </head> <body></body> </html>
Effect output:
The above is the detailed content of How to use css background-image property. For more information, please follow other related articles on the PHP Chinese website!