JAN
JAN

Reputation: 21865

Button is not moving when I change its coordinates

Given this code :

<style type="text/css">
#button{
width: 5em;  height: 2em;
background-color:#62B1F6;
font-size:20px;
position:static;
left: 400px;
top:485px;
z-index: 1;}
</style>

When I change the parameters of left,top , the button doesn't move .

What am I doing wrong ?

Upvotes: 1

Views: 44

Answers (2)

berentrom
berentrom

Reputation: 515

Try position: relative:

#button {
    width: 5em; height: 2em;
    background-color: #62B1F6;
    font-size: 20px;
    position: relative;
    left: 400px;
    top: 485px;
    z-index: 1;
}

Upvotes: 1

drip
drip

Reputation: 12943

You can't move a static object with top/bottom/left/right attributes!

It should be relative/absolute/fixed in order to apply the top/bottom/left/right attributes.

Upvotes: 1

Related Questions