【发布时间】:2018-03-12 06:09:21
【问题描述】:
我是第一次使用 ASP.NET,但我承认我在 HTML 方面已经相当缺乏经验。我正在使用引导网格,并且我正在创建一个具有这种模式的表单:
<div class="container">
<div class="row dataPanel">
<h4><b>1.First question goes here</b></h4>
<div class="col-lg-12">
<asp:RadioButtonList ID="q1Score" CssClass="radioButtonList" runat="server" RepeatDirection="Horizontal">
<asp:ListItem Value="1">1</asp:ListItem>
<asp:ListItem Value="2">2</asp:ListItem>
<asp:ListItem Value="3">3</asp:ListItem>
<asp:ListItem Value="4">4</asp:ListItem>
<asp:ListItem Value="-1">N/A</asp:ListItem>
</asp:RadioButtonList>
<br />
Comments:
<asp:TextBox ID="q1CommentBox" TextMode="MultiLine" CssClass="commentBox" runat="server" />
</div>
</div>
</div>
我的自定义 CSS 如下所示:
.radioButtonList label {
width: 25px;
margin-right: 15px;
margin-left: 2px;
display: compact;
font-size: 10pt;
text-align: center;
}
.commentBox {
border-style: solid;
border-color: dimgray;
width: 100%;
height:50%;
}
.dataPanel {
border: solid;
border-radius: 4px;
border-width: 1.5px;
padding: 20px;
}
无论我是否将注释框包含在样式为 col-12-lg 或行的 div 中,我都无法扩展行的宽度。在引导程序中,这意味着相当于 12 列,对吗?
有什么建议吗?
【问题讨论】:
-
它是否适用于
width: 100% !important;?请注意,多行文本框变成了 html 中的 TextArea,也许它在某处有自己的 CSS。 -
不,!important 标签没有任何作用。将它呈现到 TextArea 中绝对是正确的,但是我的 commentBox css 类应该适用于文本区域和文本框。我删除了 Multiline 参数以将其变成单行文本框,但它仍然是相同的宽度。
-
感谢 VDWWD,查看我的样式表中的 textarea 类显示宽度限制设置为 280 像素。
标签: html css asp.net bootstrap-4