gpt4 book ai didi

c# - 将多个文本框和标签放在同一列CSS上?

转载 作者:行者123 更新时间:2023-12-03 04:19:09 25 4
gpt4 key购买 nike

enter image description here

你好!是否可以通过 CSS 编码将多个文本框和标签放在同一列上,如图所示?以及如何?

当我这样做时,它看起来像这样: enter image description here 谢谢

最佳答案

试试这个

在您的 aspx 页面中

<form id="form1" runat="server">
<div class="row">
<asp:Label ID="Label1" runat="server" Text="Label" CssClass="label">Dropdown:</asp:Label>
<asp:DropDownList ID="DropDownList1" runat="server" CssClass="input"></asp:DropDownList>
</div>
<div class="row">
<asp:Label ID="Label2" runat="server" Text="Label" CssClass="label">Textbox 1:</asp:Label>
<asp:TextBox ID="TextBox1" runat="server" CssClass="input"></asp:TextBox>
</div>
<div class="row">
<asp:Label ID="Label3" runat="server" Text="Label" CssClass="label">Textbox 2:</asp:Label>
<asp:TextBox ID="TextBox2" runat="server" CssClass="input"></asp:TextBox>
</div>
</form>

在你的CSS文件中

.row{ display:block; height:30px;}
.label{ float:left; width:100px;}
.input{ float:left; width:100px;}

关于c# - 将多个文本框和标签放在同一列CSS上?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8325791/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com