我需要知道将什么 HTML 容器用于 ASP 表单,以便可以使用 CSS 设置样式,而无需使用 HTML insead HTML 表格。
例如 aspx 页面上的这个表单:
<form id="WPF" runat="server">
<asp:Label ID="lblCCode" Text="Country Code" runat="server">
<asp:TextBox ID="txtCCode" runat="server" Width="85"></asp:TextBox>
</asp:Label>
<asp:Label ID="lblCName" Text="Country Name" runat="server">
<asp:TextBox ID="txtCName" runat="server" Width="150"></asp:TextBox>
</asp:Label>
<asp:Label ID="lblCPop" Text="Country Population" runat="server">
<asp:TextBox ID="txtCPop" runat="server" Width="130"></asp:TextBox>
</asp:Label>
最佳答案
使用 DIV 而不是 TABLE 是众所周知的,有很多东西可以找到。
例如http://www.html-cleaner.com/features/replace-html-table-tags-with-divs/
我不知道它是否会更简单,但您有更多选择。 但是,如果您的唯一目标是仅将 CSS 用于 TABLE 的样式,那么有关 TABLE 的所有内容都可以使用 CSS 进行陈旧。参见 here
关于asp.net - 什么 HTML 容器用于 ASP 表单而不是 HTML 表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30442596/