如何将div表放置在从上往下的位置?
<body>
<div id="container">
<div id="body">
<center>
<table width="650" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td align="center" height="40"><img src="logo.jpg" alt=" Store" width="100" height="30"></td>
</tr>
<tr>
<td height="20" align="center" class="intro"> <a href="">online store</a> | <a href="">main website</a></td>
</tr>
<tr>
<td height="352" align="center"><img src="str.jpg" width="500" height="500"></td>
</tr>
</tbody>
</table>
</center>
</div>
<!-- Ola sto span class mporoun na xwresoun? -->
<div id="footer" class="intro"><span style class="bottom"> email | the store | address | tel </div>
</div>
</body>
该表现在位于浏览器的中心。我想要改变的不是从最顶部开始,我希望表格稍微低一点,例如距顶部 30 像素。
好吧,我通过在 标记之前添加
使整个表格变低,但这太荒谬了。我还能做什么?
<body>
<div id="container">
<div id="body">
<center>
<table width="650" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td align="center" height="40"><img src="logo.jpg" alt=" Store" width="100" height="30"></td>
</tr>
<tr>
<td height="20" align="center" class="intro"> <a href="">online store</a> | <a href="">main website</a></td>
</tr>
<tr>
<td height="352" align="center"><img src="str.jpg" width="500" height="500"></td>
</tr>
</tbody>
</table>
</center>
</div>
<!-- Ola sto span class mporoun na xwresoun? -->
<div id="footer" class="intro"><span style class="bottom"> email | the store | address | tel </div>
</div>
</body>
The table is now in the center of the browser. The thing I wanna change is not to start from the very top, I want the table to be a little lower, for example 30 pixels from the top.
Ok well I made the whole table go lower by adding <br>
before the <table>
tag but this is ridiculous. What else can I do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用
是降低桌子高度的完美方法。虽然你可以使用 CSS 样式来实现,这会给你更精确的移动。我通常使用填充Using
<br>
is perfect way to lower the table down. Although you can do it with CSS styles which will give you more precise movement.I typically use padding您可以使用 style 属性在其上添加边距:
您还可以使用百分比值,例如:
You can put a margin on it with the style attribute:
You could also use a percentage value, eg: