valign与HTML中的text-align

我无法通过以下代码弄清楚上下文中的valign与text-align之间的区别:
<table width="500" border="0">
  <tr>
        <td colspan="2" style="background-color:#FFA500;">
   <h1>Main Title of Web Page</h1>
   </td>
      </tr>

  <tr valign="top">
      <td style="background-color:#FFD700;width:100px;text-align:top;">
      <b>Menu</b><br />
    HTML<br />
      CSS<br />
  JavaScript
     </td>
   <td style="background-color:#EEEEEE;height:200px;width:400px;text-align:top;">
      Content goes here</td>
    </tr>

   <tr>
     <td colspan="2" style="background-color:#FFA500;text-align:center;">
     copyright © 2012</td>
   </tr>
   </table>

解决方法

text-align的正确值是水平的,而valign是垂直的,因此它是top | middle | bottom | baseline.您也可以在两者上使用inherit.

另外,text-align是css,而valign是html属性.我认为align是与text-align相当的html,而vertical-align相当于valign.

http://www.w3schools.com/cssref/pr_text_text-align.asp

http://www.w3schools.com/tags/att_td_valign.asp

如果将text-align切换为“bottom”,您会注意到它不会移动,因为bottom对text-align无效.认(我认为)是最高的.如果你把“vertical-align:bottom”放在底部,那么它将会显示底部.

一个简单的网络搜索会找到你这些答案……

相关文章

Mip是什么意思以及作用有哪些
怎么测试Mip页面运行情况
MIP安装的具体步骤有哪些
HTML添加超链接、锚点的方法及作用详解(附视频)
MIP的规则有哪些
Mip轮播图组件中的重要属性讲解