asp.net前台控件对齐问题 基于C#,ASP.NET开发:图片一图片二图片一是我现在的样式,大家会看到图片一的那些文本框,按钮,下拉控件这样不对齐,看上去很乱。我要在.aspx文件里怎样做才能实现像图片二的样式呢?使得这些控件对齐!让页面更好看一些!谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 一是用tabel 布局或用div span 等将其 固定宽度style='width:200px'或是楼主把代码贴出一部分可以针对你的做调整 谢谢你 我试试,不行的话,我贴代码 让你们看看!<body> <form id="form1" runat="server"> <div> user:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br/> password:<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox><br/> <asp:Repeater ID="Repeater1" runat="server"> <ItemTemplate> <%#Eval("ids") %> <%#Eval("title") %> <br /> </ItemTemplate> </asp:Repeater> <asp:DataList ID="DataList1" runat="server" BackColor="#aaffaa" Width ="100%" Height="200px"></asp:DataList> <input type = "checkbox" name="Namecheck" value ="check" /><br/> <div style ="width:200px">suspected_problem_area<asp:Button ID="SusProAre_Btn" runat="server" Text="Button" style=""/>Plateform Driver </div> <label style="margin-left:50px;">ingredient <asp:Button ID="Ingredient_Btn" runat="server" Text="Button" />Camera</label><br/> <label style ="width:200px"> ingredient_sku_name <asp:Button ID="IngSkuName_Btn" runat="server" Text="Button" style="flex-item-align:auto"/>SW Camera Drivers</label> <label style="margin-left:50px;">found_in_component<asp:Button ID="FoundInComponent_Btn" runat="server" Text="Button" />Cam mini-port driver</label> <br/> </div> </form></body> <style type="text/css"> .class1 { width:100px; height:30px; } .class1 { width:200px; height:30px; } </style></head><body> <form id="form1" runat="server"> <div> <div> <span class="class1">user:</span> <span class="class2"> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> </span> </div> <div> <span class="class1">user:</span> <span class="class2"> <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> </span> </div> <div> <span class="class1">user:</span> <span class="class2"> <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox> </span> </div> </div> </form></body> 用table 或者div然后写CSS来控制。table div 固定一个长度。 谢谢 上面的朋友热心帮忙,我用table 实现了效果! AD域的代码写在前台页面还是写在后台服务器服务器 请教个简单的类型转换问题 文件“F:\jiayiDemo\FrameWork.web\SiteXml\SiteInfo.xml”正由另一进程使用,因此该进程无法访问该文件。 页面上有个添加按钮,程序运行成功的,当我添加一条记录后刷新页面,它自动又添加一条,这样怎么修改? datagrid编辑是出现“指定的转换无效”的错误 生存文件上传控件取值问题 中间表类设计 如何不让用户登录后的信息保存下来。 文件上传问题!请帮帮忙! 使用ADSI修改AD密码出错,不知哪位是否能帮上忙 关于Attribute和泛型的问题 再出一道面试题,禁止查百度或谷歌
或用div span 等将其 固定宽度
style='width:200px'或是楼主把代码贴出一部分可以针对你的做调整
谢谢你 我试试,不行的话,我贴代码 让你们看看!<body>
<form id="form1" runat="server">
<div> user:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br/>
password:<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox><br/>
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<%#Eval("ids") %> <%#Eval("title") %> <br />
</ItemTemplate>
</asp:Repeater>
<asp:DataList ID="DataList1" runat="server" BackColor="#aaffaa" Width ="100%" Height="200px"></asp:DataList>
<input type = "checkbox" name="Namecheck" value ="check" /><br/>
<div style ="width:200px">suspected_problem_area<asp:Button ID="SusProAre_Btn" runat="server" Text="Button" style=""/>Plateform Driver </div>
<label style="margin-left:50px;">ingredient <asp:Button ID="Ingredient_Btn" runat="server" Text="Button" />Camera</label><br/>
<label style ="width:200px"> ingredient_sku_name <asp:Button ID="IngSkuName_Btn" runat="server" Text="Button" style="flex-item-align:auto"/>SW Camera Drivers</label>
<label style="margin-left:50px;">found_in_component<asp:Button ID="FoundInComponent_Btn" runat="server" Text="Button" />Cam mini-port driver</label> <br/> </div>
</form>
</body>
.class1 {
width:100px;
height:30px;
}
.class1 {
width:200px;
height:30px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<div>
<span class="class1">user:</span>
<span class="class2">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</span>
</div>
<div>
<span class="class1">user:</span>
<span class="class2">
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</span>
</div>
<div>
<span class="class1">user:</span>
<span class="class2">
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
</span>
</div>
</div>
</form>
</body>
table div 固定一个长度。