Explain how to move a button in HTML page

Asked By 20 points N/A Posted on -
qa-featured

I can't seem to figure, how exactly to move a button in HTML.

I have a menu but I want to move the buttons from the left to the right.

Unfortunately I can not provide you with the code I have, but I am sure that you know methods on how to move a button in HTML even without my initial code.

Any help would be appreciated.

Thank you in advance.

SHARE
Answered By 0 points N/A #173647

Explain how to move a button in HTML page

qa-featured

You can add the new place to a class:

.class {top:100; left:100;}

and then add that category dynamically through javascript:

elem.className = "class";

or you can straight set the inline design feature of top/left (or bottom/right, or top/right, or bottom/left)

elem.setAttribute('style', 'top:100px;left:150px;');

or you can use elem.style, whatever you like.

Or

1 down vote    

I'm supposing you set the preliminary place with this CSS:

#theButtonID {
    left:8px;
    top:16px;
}

Well, all you have to do is set:

with(document.getElementById(theButtonID).style) {
    remaining = "64px";
    top = "128px";
}

Note that if you want a sleek activity, add this CSS to the button:

transition:top 1s convenience, remaining 1s ease;
-webkit-transition:top 1s convenience, remaining 1s ease;

Login/Register to Answer

Related Questions