这是我桌子的一部分。我在td中有一个按钮和2张图像。我想将它们移到中心。我该怎么做?我已经尝试填充,保证金。但是它们不起作用。
<td align="center" style="width: 200px;">
<input type="button" name="submit" onClick="mySubmit();"
style="position: relative; float: left; top: 10%" value=" GO ">
<a href="#" style="position: relative; float: left; top: 2%;" onClick="mySubmit();">
<img src="../images/refresh.png" style="position:relative;">
</a>
<input type="checkbox" name="upsCheckbox" id="upsCheckbox" onChange="setRefresh(this.checked)"/>
<a href="#" style="position: relative; float: left; top: 2%;" onClick="enterFullscreen();">
<img src="../images/FullScreen.jpg" style="position: relative; top:2%;">
</a>
</td>
简化的HTML:
<table>
<tr>
<td style="width: 400px;">
<input type="button" value=" GO ">
<a href="#"><img src="1.jpg"></a>
<input type="checkbox">
<a href="#"><img src="2.jpg"></a>
</td>
</tr>
</table>
CSS:
td {
vertical-align: middle;
text-align: center;
}
td a, td input, td img {
vertical-align: middle;
display: inline-block;
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句