Home > Web Front-end > Front-end Q&A > How to use css background-image property

How to use css background-image property

藏色散人
Release: 2019-05-29 10:13:35
Original
4778 people have browsed it

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 css background-image property

#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(&#39;https://img.php.cn/upload/article/000/005/656/5af270fd37755429.jpg&#39;);}
</style>
</head>
<body></body>
</html>
Copy after login

Effect output:

How to use css background-image property

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template