我需要放置一个图像...在带有背景图像的 div 内的右下角..问题是图像放置时没有 div 的背景。
我有这个...我使用样板
<style>
#footer-container{
background: url("img/footer_bg.gif") repeat;
color: #ccc;
padding:20px 0;
}
#footer-container footer{
background: url("img/footer_bg.gif") repeat;
color: #ccc;
padding:20px 0;
}
.wrapper{
width:1026px; /* 1140px - 10% for margins */
margin:0 auto;
}
#resize{
float:right;
}
</style>
<div id="footer-container">
<footer class="wrapper">
<p class="contacto">
<i>
some text here....
<a href="#">—Contact</a>
</i>
</p>
<div id="contacts">
<a href="#" class="twitter-link">twitter</a>
<a href="#" class="dribble-link">dribble</a>
<a href="#" class="rss-link">rss</a>
</div>
<div id="resize">
<img src="img/resize.png"
style="position:absolute;right:0px; top:bottom; z-index:2;">
</div>
</footer>
</div>
最佳答案
我不确定我是否完全理解这个问题。但是,如果您希望图像绝对定位在 div 内,那么我会添加 position:relative;
到您想要将图像锚定在其中的 div。
关于html - 在右下角放置图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9295914/