這裏是我的代碼垂直對齊頂部的CSS
<div style="margin:0;padding:0;vertical-align:text-top; border:1px solid red;float:right;">
<span>Key:</span>
<asp:TextBox ID="tbKey" MaxLength="16" runat="server" ></asp:TextBox>
<asp:ImageButton ID="btnRefresh" runat="server" imageUrl="_img/btn_submit.gif" Height="22" Width="52" />
</div>
我想所有的三個要素簡單地在頂部排隊。這是可行的嗎?
編輯: 的源代碼(渲染)是
<div style="margin:0;padding:0;vertical-align:text-top; border:1px solid red;float:right;">
<span>Key:</span>
<input name="tbKey" type="text" maxlength="16" id="tbKey" />
<input type="image" name="btnRefresh" id="btnRefresh" src="_img/btn_submit.gif" style="height:22px;width:52px;border-width:0px;border-width:1px;" />
</div>
這就是你的.net代碼。向我們展示呈現的HTML/CSS。 – 2011-02-22 21:09:12
剛編輯的問題,見上面的 – sarsnake 2011-02-22 21:45:51