所以我最近编写了一个游戏(游戏agar.io的克隆),并且遇到了这个问题,我无法移动按钮。它卡住了,即使加左:X;和top:X;我搜索了很多地方进行修复,但找不到任何东西。 下面是代码:我无法移动按钮(HTML&CSS)
<button style="width: 15%;float: left !important; left: 10px; and top: 10px;" onclick="document.getElementById('id01').style.display='block'" class="btn btn-success">Select Skin <i class="fui-user"></i></button>
谢谢,对不起,如果它有点不清楚。
你需要'position:absolute',而不是'float:left'。 – JJJ
左/右:xx沿着位置工作:相对/绝对/固定(最终粘性),但不带静态,这是默认值;) –
非常感谢,这工作! –