html - CSS:如何在单元格表的两端放置控件

标签 html css

我在单元格表格中有一个按钮和一个文本框。如何进行样式设置,以便两个控件都位于相反的位置。现在,按钮贴在文本框上。我希望它们位于表格单元格的两个极端。

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

最佳答案

试试这个:

<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>

关于html - CSS:如何在单元格表的两端放置控件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12372969/

相关文章:

html - CSS 内容离开屏幕

HTML/CSS : One element, 1 像素高,100% 宽,0 个图像,单色,所有浏览器

html - 如何在html5 canvas上绘制圆柱体

javascript - 将单选按钮更改为图像会导致 jquery 验证丢失

asp.net - 背景图像不工作

html - 搜索字段中的搜索图标

javascript - 这有点抽象,但是你能得到一个从底 Angular 之一开始的 div 吗?

html - 从 maxcdn 服务器获取 css 时覆盖不使用 Bootstrap

javascript - 将 url 链接添加到轮播文本

html - 样式化的 css 不会出现在 firefox 中