valign =“top”在td中不起作用 [英] valign=“top” not working in td
问题描述
我的问题在这里发布为已解决,但显然我不明白解决方案(?)。我有很多遗留的html似乎在我的浏览器中开始失败,我不知道为什么,也许是因为不支持的属性? (顺便说一下,非常令人沮丧。为什么要消除这些数十年来工作得很好的简单属性?我不会扯掉任何人对我的编码风格的看法,只要它有效。)
My problem is posted as "solved" here, but apparently I don't understand the solution (?). I have piles of legacy html that appears to be starting to fail in my browser, I dunno why, maybe because of "unsupported" attributes? (Extremely frustrating, by the way. Why eliminate these much simpler attributes that worked fine for decades? I don't give a frickin' rip what anyone thinks of my coding style, as long as it WORKS.)
特别是,我使用和valign不起作用。
所以我尝试了以下方法,但从未取得过成功:
In particular, I use and the valign doesn't work. So I tried the following, with never a success:
<td align=center vertical-align:top>
<td text-align:center; vertical-align:top>
<td text-align:center; vertical-align:text-top>
<td vertical-align:text-top>
现在我只是更加沮丧。有什么建议吗?
Now I'm only more frustrated. Any suggestions?
推荐答案
vertical-align:top
是不应该的发生在 td
标签本身。你必须将它放在 style =
行或 td
的CSS规则中。
The vertical-align:top
is not supposed to occur in the td
tag itself. You have to put it in a style=""
line or in the CSS rules for td
.
使用 style =
:
<td align="center" style="vertical-align:top">
<td style="text-align:center; vertical-align:top">
<td style="text-align:center; vertical-align:text-top">
<td style="vertical-align:text-top">
对于CSS方法,您必须为每个<$ c $提供单独的类或ID c> td 为了使他们的风格不同。
For the CSS method, you will have to give a seperate class or id to each td
in order for their styles to be different.
这篇关于valign =“top”在td中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!