如何对齐网站底部的图像

时间:2015-09-18 13:27:47

标签: html alignment

我想对齐网站底部的Aligned Images链接中显示的图片。我的意思是我想在页面底部放置许多电影DVD封面,以便直接访问任何电影。因此,如果有人在电影“爆炸”中徘徊,那么它会弹出。谁能帮我吗。

enter image description here

3 个答案:

答案 0 :(得分:0)

请尝试以下代码。

<img  src="http://i.imgur.com/KjuqA1l.png" style="position:fixed;bottom:0px;">

更新

<img  src="http://i.imgur.com/KjuqA1l.png" style="position:fixed;bottom:0px;max-width:100%;">

答案 1 :(得分:0)

img {
    position: absolute;
    bottom: 0;
}

小提琴:http://jsfiddle.net/dwtp7pje/

请注意,如果您将图像放在另一个div中,则需要为该div指定一个position: relative;才能生效。

修改:如果您想在底部放置多个图片,请将图片放在这样的div中:

<div>
    <img src="http://orig12.deviantart.net/2b79/f/2008/314/e/8/my___dark_knight___dvd_cover_by_esbe77.jpg" alt="">
    <img src="http://orig12.deviantart.net/2b79/f/2008/314/e/8/my___dark_knight___dvd_cover_by_esbe77.jpg" alt="">
    <img src="http://orig12.deviantart.net/2b79/f/2008/314/e/8/my___dark_knight___dvd_cover_by_esbe77.jpg" alt="">
</div>

用css:

div {
    position: absolute;
    bottom: 0;
}

img {
    max-width: 33%;
}

小提琴:http://jsfiddle.net/dwtp7pje/1/

答案 2 :(得分:0)

这是在css

      .fix{
         position:fixed;
         bottom:0px;
           }

和你的HTML

     <img src="yourimagepath" class="fix"/>

绝对:基于其最近的相对定位的父元素绝对定位。

修正:固定元素在网页上完全独立。无论父母如何,固定位置元素将始终基于浏览器窗口

固定
相关问题