图片居于
后面?

| 我正在使用javascript / html中的500px x 400px \“ div \”,我希望将750px x 600px的图像(在photoshop中制作)放置在其后居中作为边框。有人能指出我正确的方向吗?     
已邀请:
据我了解,您希望图像显示在较小的div周围。您也可以删除内部的白色bg使其通过。 http://jsfiddle.net/XJLTG/2/
#wrap{
    width: 550px;
    padding: 100px;
    background: url(http://example.com/img.png);
}

#inner{
    width: 500px;
    height: 400px;
    background: white /*whatever you want*/;
    margin: 0 auto;
}

<div id=\"wrap\">
    <div id=\"inner\">
    </div>
</div>
    
有一个容器div,其位置为:relative;以图片为背景的图片大小,并将较小的div绝对放在其顶部(使用顶部和左侧css属性将其居中)。应该做到的。 干杯!     

要回复问题请先登录注册