在右边和左边的背景图象

Tyi*_*ilo 4 html css background-image css-float

我如何让它工作?

<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>
Run Code Online (Sandbox Code Playgroud)

Rya*_*lah 5

如果div为空,则不会出现任何内容,因为它们的高度和宽度为零.要显示背景图像,请指定高度和宽度.