9

我的按钮总是浮动在浏览器窗口的底角。

后退按钮在正确的位置,但下一个按钮不会正确浮动。

#footerback {
    width: 107px;
    background-position: top;
    padding: 0px 30px 30px 0px;
    position: fixed;
    bottom: 0px;
    float: left;    
}
#footernext {
    width: 107px;
    background-position: top;
    padding: 0px 30px 0px 30px;
    position: fixed;
    bottom: 0px;
    float: right;   
}

我该如何解决?

4

5 回答 5

29

试试这个 CSS 把它放在右下角;

position:fixed;
right:0;
bottom:0;
于 2012-05-31T12:43:33.790 回答
4

将你的两个按钮放在另一个 div 中,并在这个 div 上应用更好的 css:

#footer {
    position:fixed;
    left:0;
    bottom:0;
}
#footerback,
#footernext {
    text-align: center;        
    width: 50px;
    float: left;
    border: 1px solid black;      
}
<div id="footer">
    <div id="footerback">back</div>
    <div id="footernext">next</div>
</div>

于 2012-05-31T12:49:53.223 回答
4

HTML

<div class="circle-div"></div>

CSS

.circle-div {
    background-color: #314963;
    height: 40px;
    width: 40px;
    border-radius: 100%;
    position: fixed;
    bottom: 21px;
    right: 25px;
}

这会在页面的右下角放置一个圆形。

于 2018-03-27T10:42:31.777 回答
2

这将起作用 position:fixed; right:0px; bottom:0; margin:0px; padding:0px;

于 2012-05-31T13:17:52.370 回答
0

你对你的元素说他们需要一个固定的位置。然后在你说它们可以漂浮在页面上的地方添加 css。正确的答案是:准确说出他们需要去的地方。就像萨夫拉兹一样!

于 2012-05-31T12:48:11.893 回答