Html 按钮未定位在镀铬中

Html 按钮未定位在镀铬中,html,css,Html,Css,好的,我的html中有很多按钮,但并不是所有的按钮都是定位的。一两个是,其余的不是。这是其中一个正在运行的注释的代码: <button title="Go through the gate" type="button" onclick="Dungeonmove()" style="top: 900; left: -400; postion: relative; z-index: 1; visibility: show;">Go north</button> <bu

好的,我的html中有很多按钮,但并不是所有的按钮都是定位的。一两个是,其余的不是。这是其中一个正在运行的注释的代码:

<button title="Go through the gate" type="button" onclick="Dungeonmove()" style="top: 900; left: -400; postion: relative; z-index: 1; visibility: show;">Go north</button>
<button title="Stats" type="button" onclick="lco()" style="top: 0; left: 350; position: relative; z-index: 1; visibility: show;">Check your stats</button>
向北走
还有一个正在发挥作用:

<button title="Go through the gate" type="button" onclick="Dungeonmove()" style="top: 900; left: -400; postion: relative; z-index: 1; visibility: show;">Go north</button>
<button title="Stats" type="button" onclick="lco()" style="top: 0; left: 350; position: relative; z-index: 1; visibility: show;">Check your stats</button>
检查您的统计信息

那么有什么区别呢?为什么有些按钮没有定位呢?有人知道吗?

您需要指定一个单位值。唯一不需要的时间是数字
0

向北走
检查你的数据

另外,检查你的代码是否有拼写错误。你写了
position
而不是
position

蝙蝠的右边,我看到上面的是position:absolute,下面的是position:relative。你的目标是什么?您可能需要更改您的方法

看起来您在顶部和左侧的声明中没有使用“px”

<button title="Go through the gate" type="button" onclick="Dungeonmove()" style="top: 900px; left: -400px; position: absolute; z-index: 1; visibility: show;">Go north</button>
向北走

以绝对像素值定位是一种迹象,表明您几乎肯定在做一些非常非常错误的事情……~我知道,这是一个输入错误,我很快就改变了。我是怎么误解的?你不是说我应该像我一样将“位置:绝对”改为“位置:相对”吗?我是说你根本不应该使用
Position:xxxxx
。逐像素布局是一种非常糟糕的做法,在其他浏览器/计算机上很快就会崩溃,调试会非常痛苦,而且通常是一个糟糕的想法。@DoorknobofSnow+1,让我们举更多的例子,比如不同大小的屏幕,或者在手机上使用该网站,或者需要更大的文本以便于访问。话虽如此,通过代码片段来看,它确实看起来像是游戏控件,可以认为它的位置绝对像HUD一样覆盖。这很好。您是否也将
位置
更改为
位置
?。。。你是上帝:3。成功了!谢谢我不敢相信我错过了。。。即使当我看了你的小提琴>。将来,如果你倾向于犯这样的拼写错误,请运行你的代码,并帮助你找出那些容易犯的错误:)