How to cancel the automatic filling of images in css

WBOY
Release: 2021-11-29 17:42:58
Original
2814 people have browsed it

In CSS, you can use the "background-repeat" attribute to cancel the automatic filling of pictures, and the syntax is "picture element {background-repeat:no-repeat;}".

How to cancel the automatic filling of images in css

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

How to cancel the automatic filling of images in css

We can cancel the automatic filling of images through the "background-repeat" attribute, which is used Set whether and how to repeat the background image. By default, the background image repeats horizontally and vertically.

When the value of this attribute is no-repeat, it means that the picture will not be automatically filled.

How to cancel the automatic filling of images in css

The example is as follows:

<html>
<head>
<style type="text/css">
body{ 
background-image: 
url(/i/eg_bg_03.gif);
}
</style>
</head>
<body>
</body>
</html>
Copy after login

Output result:

How to cancel the automatic filling of images in css

When adding background-repeat:no -repeat; style, output result:

How to cancel the automatic filling of images in css

(Learning video sharing: css video tutorial)

The above is the detailed content of How to cancel the automatic filling of images in css. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!