为什么我的左边距没有应用到我的单选按钮?
Why is my left margin not being applied to my radio button?
我知道了 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>
</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>
...然而,尽管左边距应用于 h4 元素和 select 元素,但 not 应用于输入单选元素:
为什么不呢?我怎样才能让单选按钮与其他元素一起在 pixelstep 中也向东移动?
尝试在您的代码中添加 !important
异常:
.leftmarginbreathingroom {
margin-left: 8px !important;
}
输入元素有时有默认边距设置。在你的 CSS 某处可能有一个
input { margin: 0 !important; }
这会阻止您的 .leftmarginbreathingroom
规则生效。为了解决这个问题,将 !important
添加到您的规则中会起作用。
不是 crct,只是 hack
<span className="text-white">hhh</span><input type="radio" >...</input>
我知道了 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>
</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>
...然而,尽管左边距应用于 h4 元素和 select 元素,但 not 应用于输入单选元素:
为什么不呢?我怎样才能让单选按钮与其他元素一起在 pixelstep 中也向东移动?
尝试在您的代码中添加 !important
异常:
.leftmarginbreathingroom {
margin-left: 8px !important;
}
输入元素有时有默认边距设置。在你的 CSS 某处可能有一个
input { margin: 0 !important; }
这会阻止您的 .leftmarginbreathingroom
规则生效。为了解决这个问题,将 !important
添加到您的规则中会起作用。
不是 crct,只是 hack
<span className="text-white">hhh</span><input type="radio" >...</input>