Calvin Leon Calvin Leon - 1 year ago 78
CSS Question

I am not able to move a Button (HTML & CSS)

So I have recently been coding a game (a clone of the game, and I have run into this problem where I can't move a button. its stuck, even though if add left: X; and top: X; I have searched so many places for a fix, but can't find anything.
Here is the code:

<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>

Thanks, sorry if its a bit unclear.

Answer Source

The box offset properties that you are using (left et al) only apply to positioned elements.

These are elements where the position property is set to a value other than static, but static is the default and you haven't changed it.

Look at absolute, fixed, and relative.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download