CSS 浮动 - 底角

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10833842/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 04:03:21  来源:igfitidea点击:

CSS float - bottom corners

csscss-float

提问by Ma9ic

I have buttons that always float at the the bottom corner of the browser window.

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

The backbutton is in the correct place, but the nextbutton won't float right.

按钮是在正确的位置,但下一个按钮将不对浮动。

#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;   
}

How do I fix this?

我该如何解决?

回答by Sarfraz

Try this CSS to put it at bottom right;

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

position:fixed;
right:0;
bottom:0;

回答by zessx

Put your both buttons in another div, and apply a better css on this div:

将两个按钮放在另一个 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>

回答by Gaurav Gandhi

This will work position:fixed; right:0px; bottom:0; margin:0px; padding:0px;

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

回答by Victor Ifeanyi Ejiogu

HTML

HTML

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

CSS

CSS

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

This places a round circle around the bottom right of the page.

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

回答by Joeri Minnekeer

You're saying to your elements that they need a FIXED position. Then you add css where you say that they can float on the page. The right answer is: say exactly where they need to be. Like Safraz did!

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