Reputation: 131
I have below two lines of code. show1 and show2 are buttons on my JSP Page that position according to below code. However, button show2 is displayed little lower that button show1. How to resolve this issue.
document.getElementById('show1').style.marginTop="33%";
document.getElementById('show2').style.marginTop="33%";
Upvotes: 0
Views: 284
Reputation: 3376
Make sure you are using position: absolute;
for each of them.
document.getElementById('show1').style.position = 'absolute';
document.getElementById('show2').style.position = 'absolute';
Upvotes: 1