2012-09-11 43 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右邊。

這可能會導致第二個出現在稍低的位置,在這種情況下,您應該先讓它浮動。

相關問題