CSS背景重复问题 [英] CSS Background repeat issue

查看:155
本文介绍了CSS背景重复问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨我似乎无法让我的背景不重复,甚至得到一个边界在这里显示的是code

Hey guys i cant seem to get my background to not repeat or even get a border to show here is the code

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 &nbsp;the same services as big hotels like cooked meals, airport shuttles, satellite TV, internet connectivity&nbsp; 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;
}

老实说,我已经试过我能在网上找到各种方法,但不能得到这个工作:/我没有看到任何冲突在这里,但我可能失去了一些东西。

Honestly i have tried every which way i could find online but cannot get this to work :/ i dont see any conflicts here but i might be missing something.

这发生在所有我测试

感谢提前输入。

推荐答案

您缺少在背景图片属性的结束分号,因此,该下一个属性失败即背景重复

You are missing a semi-colon at the end of the background-image property and hence, the next property fails i.e background-repeat

background-image:url('images/prodblock.jpg');
                                          --^--

这篇关于CSS背景重复问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆