Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
I've tried putting valign="top" as attribute of <td> but in vain.
<td>
<tr> <td> <span class="validationInline">*</span> Security Code: </td> <td valign="top"> <input type="text" /> <iframe scrolling="no" height="21px" frameborder="0" width="62px" marginheight="0" marginwidth="0" src="http://google.com"></iframe> </td> </tr>
It seems that <input> aligns itself to the buttom,while <iframe> to the top.
<input>
<iframe>
根据您的描述,单元格似乎与顶部对齐,但输入/iframe 在底部彼此对齐。垂直对齐通常只适用于兄弟元素。
您需要做的是vertical-align:top在输入和 iframe 上设置 CSS 属性。
vertical-align:top
<td valign="top"> <input style="vertical-align:top" type="text" /> <iframe style="vertical-align:top" scrolling="no" height="18" frameborder="0" width="62" marginheight="0" marginwidth="0" src="http://google.com"> </iframe> </td>
<td valign="top"><input type="text" /> <iframe scrolling="no" height="18" frameborder="0" width="62" marginheight="0" marginwidth="0" src="http://google.com"> </iframe></td>
The above works for me... It aligns the content to the top of the cell. Is this what you're after?