嘿伙计们,我似乎无法让我的背景不重复,甚至无法让边框显示在这里是代码
HTML:
<div id="content">
<div class="product">
<p><strong>Wonderful Guest House</strong></p>
<p><img src="images/knysna.jpg" width="282" height="171" align="absmiddle" /></p>
<p>Guest Houses are great alternative accommodation to expensive hotels when travelling for business or for pleasure. Most guest houses offer the same services as big hotels like cooked meals, airport shuttles, satellite TV, internet connectivity and even conferencing facilities. </p>
<p class="style1">>> <a href="#">Visit Website …. </a></p>
</div>
</div>
CSS:
#content{
width:90%;
margin-top: 60px;
margin-left:5%;
margin-right:5%;
background-color:#CCC;
background-image:url('images/prodblock.jpg')
background-repeat: no-repeat;
}
.product{
width:318px;
display:block;
float: left;
}
老实说,我已经尝试了所有可以在网上找到的方法,但无法让它工作:/我在这里没有看到任何冲突,但我可能会遗漏一些东西。
这发生在我测试过的所有浏览器中
提前感谢您的输入。
最佳答案
您在 background-image
属性末尾缺少分号,因此,下一个属性失败,即 background-repeat
background-image:url('images/prodblock.jpg');
--^--
关于CSS背景重复问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16393190/