2012-09-11 39 views
0

我在单元格表格中有一个按钮和一个文本框。我该如何做造型,使两个控件位于相反的位置。现在,按钮粘贴到文本框。我希望他们成为表格单元的两个极端。CSS:如何将控件放置在单元格表格的两个极点上

<td style= "width:300px"> 
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>  
    <asp:Button ID="Button1" runat="server" Text="Button" /> 
</td> 

回答

1

试试这个:

<td style= "width:300px"> 
    <asp:TextBox ID="TextBox1" runat="server" style="float:left;"></asp:TextBox>  
<asp:Button ID="Button1" runat="server" Text="Button" style="float:right;"width:100px; /> 
</td> 
1

做出第一个“style = float:left”,第二个可以是一个float右边。

这可能会导致第二个出现在稍低的位置,在这种情况下,您应该先让它浮动。

相关问题