我想出了如何将图标修复到页面底部,但现在由于某种原因只会显示一个。我试图将它们各自放在自己的div中,但仍然没有工作?
HTML:
<div style="position: relative">
<img src ="./images/tw.jpg">
<img src ="./images/ig.jpg">
<img src ="./images/fb.jpg">
</div>
CSS:
img {
height: 40px;
width: 40px;
position: fixed;
bottom: 0;
text-align: center;
}
答案 0 :(得分:1)
<div class="container">
<img src ="./images/tw.jpg">
<img src ="./images/ig.jpg">
<img src ="./images/fb.jpg">
</div>
<style>
.container {
position: fixed;
bottom: 0;
width: 100%;
text-align: center;
}
.container img {
height: 40px;
width: 40px;
}
</style>
答案 1 :(得分:1)
在div
中添加position:fixed
div {
position: fixed;
bottom: 0;
width: 100%;
text-align: center;
}
答案 2 :(得分:0)
从css中删除'position:fixed'或将其替换为'position:relative'