我想要做的是避免这两个按钮在浏览器页面重新缩放到较小尺寸时互相碰撞。避免按钮在重新缩放时碰撞
我试图使用保证金,但由于两个按钮都处于绝对位置,它根本不起作用。
下面是这个
#appButtons{
\t height:40px;
\t width:125px;
\t background-color:#000080;
\t border:solid 1px #000080;
\t color:white;
\t border-radius:4px;
\t text-align:center;
\t margin-bottom:0px;
}
#appButtons:hover{
\t background-color:#E9E9E9;
\t color:#000080;
}
<table>
<tr style="display:none">
<button id="appButtons" name="see_words" style="position:absolute;left:25%;top:10%;display: inline-block;">Check words in your dictionary</button><br>
</tr>
<tr>
<button id="appButtons" name="add_words" style="position:absolute;right:25%;top:10%;display:inline-block;">Add words to your dictionary</button><br>
</tr>
</table>
真的有必要的按钮被绝对定位? –
@RalphDavidAbernathy不一定,但我怎么能够将它们放在“任何位置”,而不移出父div? – leveeee
您真的想如何定位按钮?你想让它们在水平和垂直方向都居中,并且每个按钮周围都有一些边距?你可以定义“任何地方”?试图帮助你解决这个问题。 –