Html 如何在右下角放置静态按钮?

Html 如何在右下角放置静态按钮?,html,css,bootstrap-4,Html,Css,Bootstrap 4,我需要在页面的右下角放置一个按钮,并将其设置为静态。它需要保持在原来的位置,以防滚动 我试着把它放在css上,但是我没有足够的级别 <input type="button" onclick="delegar.php" id="delegar" value="Delegar"> #delegar { position:relative; rigth: 100%; bottom: 100%; } #德莱加{ 位置:相对位置; 正确率:100%; 底部:100

我需要在页面的右下角放置一个按钮,并将其设置为静态。它需要保持在原来的位置,以防滚动

我试着把它放在css上,但是我没有足够的级别

<input type="button" onclick="delegar.php" id="delegar" value="Delegar">

#delegar {
    position:relative;
    rigth: 100%;
    bottom: 100%;
}

#德莱加{
位置:相对位置;
正确率:100%;
底部:100%;
}
更改您的CSS

#delegar {
    position:fixed;
    right: 10px;
    bottom: 10px;
}

您需要将元素的位置设置为“固定”。见下例:

.fixed {
position: fixed;
bottom: 10px;
right: 10px;
}

您可以使用“位置固定”来执行此任务。它将使您的按钮保持在底部

#delegar {
    position:fixed;
    rigth: 0;
    bottom: 0;
}

.container bottom{位置:相对;}
#德莱加{
位置:相对位置;
右:10px;
底部:10px;
}

在此处添加CSS代码。@LaljiTadhani done您可以使用position:fixed来修复它,也可以使用position:absolute来修复它。现在,您可以将此类“fixed”设置为要修复的任何元素。比如:
<div class="container-bottom">
    <input type="button" onclick="delegar.php" id="delegar" value="Delegar">
</div>

.container-bottom { position: relative; }

#delegar {
    position:relative;
    right: 10px;
    bottom: 10px;
}