Html 为什么我的左边距没有应用于我的单选按钮?
我有一个CSS:Html 为什么我的左边距没有应用于我的单选按钮?,html,css,twitter-bootstrap,radio-button,margin-left,Html,Css,Twitter Bootstrap,Radio Button,Margin Left,我有一个CSS: .leftmarginbreathingroom { margin-left: 8px; } …此HTML: <div class="row"> <div class="col-md-12"> <h4 class="h4 sectiontext leftmarginbreathingroom">Generate and Email Reports</h4> </div> <
.leftmarginbreathingroom {
margin-left: 8px;
}
…此HTML:
<div class="row">
<div class="col-md-12">
<h4 class="h4 sectiontext leftmarginbreathingroom">Generate and Email Reports</h4>
</div>
</div>
@* "On a specific day of the month" radio button and Day of month selection element *@
<div class="row">
<div class="col-md-12">
<input type="radio" id="groupRptGenerationAndSendingByDayOfMonth" class="leftmarginbreathingroom" value="day">On a specific day of the month:
<select id="dayofmonthselect" class="leftmarginbreathingroom">
@foreach (String day in daysOfMonth)
{
<option id="selItem_@(day) value=" day">@day</option>
}
</select>
<label> of each month</label>
</div>
</div>
@* "Based on a pattern" radio button and select elements *@
<div class="row">
<div class="col-md-12">
<input type="radio" id="groupRptGenerationAndSendingBasedOnAPattern" class="leftmarginbreathingroom" value="pattern">Based on a pattern
<select id="ordinalselect" class="leftmarginbreathingroom">
@foreach (String ord in ordinalWeeksOfMonth)
{
<option id="selItem_@(ord) value=" ord">@ord</option>
}
</select>
<select id="dayofweekselect">
@foreach (String dow in daysOfWeek)
{
<option id="selItem_@(dow) value="dow">@dow</option>
}
</select>
<label> of each</label>
<select id="weekormonthselect">
@foreach (String pf in patternFrequency)
{
if (pf == "Month")
{
<option id="selItem_@(pf)" value="@pf" selected="selected">@pf</option>
}
else
{
<option id="selItem_@(pf) value="pf">@pf</option>
}
}
</select>
</div>
</div>
生成和发送电子邮件报告
@*“在每月的某一天”单选按钮和月日选择元素*@
在每月的特定日期:
@foreach(以daysOfMonth为单位的字符串日)
{
@作战需求
}
@foreach(按周天数排列的道琼斯指数)
{
@pf
}
}
…然而,尽管左边距应用于h4元素和select元素,但它不应用于输入无线电元素:
为什么不呢?如何使单选按钮也与其他元素同步向东移动?尝试将异常添加到代码中:
.leftmarginbreathingroom {
margin-left: 8px !important;
}
输入元素有时具有默认的边距设置。在CSS中的某个地方可能有一个
input { margin: 0 !important; }
这将阻止您的.leftmarginbreathingroom
规则生效。要解决这个问题,请添加!重要信息
您的规则将起作用