我想把这4个按钮的方式类似于游戏控制器。
我得到的结果如下。它们应该在屏幕的中间和底部,更小,而且必须是响应的。我要改变什么?我应该用吗
#controls { position:relative;}
?
HTML代码:
<head><meta name="viewport" content="width=device-width, initial-scale=1.0"/>...</head>
<body><div id="controls">
<button id="keyboard_key_up" class="movements_control"><img src="public/img/keyboard_key_up.png"/></button>
<button id="keyboard_key_left" class="movements_control"><img src="public/img/keyboard_key_left.png" /></button>
<button id="keyboard_key_down" class="movements_control"><img src="public/img/keyboard_key_down.png" /></button>
<button id="keyboard_key_right" class="movements_control"><img src="public/img/keyboard_key_right.png" /></button>
</div>...</body>
CSS代码:
#keyboard_key_up {
position: absolute;
right:300px;
bottom: 500px;
border-style: solid;
border-color: black;
background: white;z
}
#keyboard_key_left {
position: absolute;
right:575px;
bottom: 250px;
border-style: solid;
border-color: black;
}
#keyboard_key_down {
position: absolute;
right:300px;
bottom: 250px;
border-style: solid;
border-color: black;
}
#keyboard_key_right {
position: absolute;
right:25px;
bottom: 250px;
border-style: solid;
border-color: black;
}