4
这个问题与此有关How to fill the the available height on screen with the div for any height?如何在背景中保持背景图像始终处于100%高度div的底部?
如何在背景始终保持背景图像始终处于100%高度div的底部? ,我想只显示背景图片的特定部分?
这个问题与此有关How to fill the the available height on screen with the div for any height?如何在背景中保持背景图像始终处于100%高度div的底部?
如何在背景始终保持背景图像始终处于100%高度div的底部? ,我想只显示背景图片的特定部分?
HTML:
<div id='a'>
<div id='b'></div>
</div>
CSS:
#a, html, body{
height: 100%;
}
#a {
width: 300px;
background-color: #dde;
border: 1px solid #99c;
position:relative;
overflow: hidden
}
#b {
width: 50px;
height: 50px;
background-color: #99c;
border: 1px solid #54a;
position: absolute;
bottom: -25px;
left: 125px;
}
您需要将bg图像实际添加到b
。