简体   繁体   English

不重复显示背景

[英]background not show in repeat-y

background of left and right div(column) not show.but when add "height: xx px" are shown. 左和右div(column)的背景不显示。但是添加“ height:xx px”时显示。 but my content div is flexible.how solve this problem? 但我的内容div很灵活。如何解决此问题? tnx. tnx。 my code is : 我的代码是:

<div style="background:url("image/l.png") repeat-y;float:left;width:3px;height:auto;" id="left"></div>
<div style="width: 613px;background:#fff;" id="center">
  <p>contents</p>
  <p>contents</p>
  <p>contents</p>
  .
  .
  .
  .
  .
  .
</div>
<div style="background:url("image/r.png") repeat-y;float:left;width:3px;height:auto;" id="right"></div>

组合lr .png,使它们成为1个背景图像,在#center上垂直重复,或者在必要时将它们放在center元素的父元素上。

Most likely the double quotes... for best practice, try to keep your css external. 最有可能是双引号...为了获得最佳实践,请尝试将CS​​S保持在外部。 What hunter did is perfect. 猎人所做的是完美的。

Get rid of the double quotes. 摆脱双引号。 You don't need quotes when you use url(). 使用url()时不需要引号。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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