CSS settings background picture needs to use the Background property, where the background-repeat set the way the picture tiles, no-repeat for the picture does not repeat tiles. A description of the background-repeat in the CSS manual is as follows:
Grammar:
Background-repeat:repeat | No-repeat | Repeat-x | Repeat-y
Take value:
Repeat: Default value. The background image is tiled vertically and horizontally
No-repeat: Background image uneven spread
Repeat-x: The background image is tiled horizontally only
Repeat-y: The background image is tiled only vertically
Description
Sets or retrieves whether and how the background image of an object is arranged. The background image (Background-image) of the object must be specified first.
This property is read-only for Currentstyle objects. is writable for other objects.
The corresponding script attribute is backgroundrepeat.
Example:
menu {background:url ("images/aardvark.gif"); background-repeat:repeat-y;}
P {background:url ("images/aardvark.gif"); Background-repeat:no-repeat}
In the example of this article, set the picture tile for the body:
HTML file:
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en"
"Http://www.w3.org/TR/html4/loose.dtd" >
<title> Untitled Document </title>
<body style= "Background:url (' 3.jpg ') no-repeat;" >
</body>
The effect of the following figure:
This article address: http://www.bianceng.cn/web/Css/201608/50295.htm