简体   繁体   中英

Background image on right and left side

How do I get this to work?

<html>
<head>
<style type="text/css">
.left
{
float: left;
background-image: url('image_with_variable_width.png');
background-repeat: repeat-y;
}
.right
{
float: right;
background-image: url('image_with_variable_width_flipped.png');
background-repeat: repeat-y;
}
</style>
</head>
<body>
<div class="left"></div>
<div class="right"></div>
</body>
</html>

If the divs are empty, then nothing will appear because their height and width are zero. To make the background images appear, specify a height and width.

添加DIV的高度和宽度。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM