我正在尝试将此横幅广告设置在页面底部,我怎样才能让图片在横幅 div 中占据它的位置而不超过上面的 div。
.banner {
width: 100%;
}
.banner img {
width: 100%;
max-height: 140px;
z-index: 99999999999;
position: fixed;
bottom: 0;
}
<div class="banner">
<img src="http://machahid.info/wp-content/uploads/2016/12/pubmobile.gif" alt="ads">
</div>
谢谢大家。
最佳答案
您可以根据您设置文档的方式为容器元素(body 或 div 等)提供 140px 的 padding-bottom 或 margin-bottom。这将始终在页面末尾为您的广告留出空间。
关于html - 如何设置页面末尾的div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41732055/