您现在的位置是:首页 > 电脑技术查询 > web开发

怎么让button位于窗口的底部

编辑:chaxungu时间:2022-10-02 23:20:37分类:web开发

如何让button位于窗口的底部?


------解决方案--------------------
<html>
<body>
<button style= "position:relative; "id= "btn1 "> 最底部 </button>
</body>
<script>
document.getElementById( "btn1 ").style.top=document.body.clientHeight-2*document.getElementById( "btn1 ").offsetHeight;
</script>
</html>