gpt4 book ai didi

c# - 删除 div 之间的间距,bootstrap

转载 作者:太空宇宙 更新时间:2023-11-03 23:34:45 24 4
gpt4 key购买 nike

我使用 Twitter Bootstrap 来分隔 <div>如下

<div class="row" style="padding-top:10px;">
<div class="col-lg-6 col-md-6 col-sm-4 col-xs-4" style="border-style:dotted;">
<div class="row">
<div class="col-lg-3 col-md-3 col-sm-2 col-xs-2">
<label>Period:</label>
</div>
<div class="col-lg-offset-1 col-lg-8 col-md-offset-1 col-md-7 col-sm-offset-1 col-sm-6 col-xs-offset-1 col-xs-6">
@Html.DropDownList("Period", new List<SelectListItem>() {
new SelectListItem{Text = "Last 7 Days", Value = "6"},
new SelectListItem{Text = "Last 15 Days", Value = "14"},
new SelectListItem{Text = "Last 30 Days", Value = "29"},
new SelectListItem{Text = "Last 90 Days", Value = "89"},
new SelectListItem{Text = "Last 180 Days", Value = "179"},
new SelectListItem{Text = "Last 365 Days", Value = "364", Selected = true},
new SelectListItem{Text = "Custom", Value = "0"}
})
</div>
</div>
</div>

<div class="col-lg-6 col-md-6 col-sm-4 col-xs-4" style="border-style:solid;">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-4 col-xs-4">
<input type="text" id="FromDatePicker" readonly="readonly" placeholder="From Date" style="display: none; width: 78px; line-height: 25px;">
</div>
<div class="col-lg-6 col-md-6 col-sm-4 col-xs-4">
<input type="text" id="ToDatePicker" readonly="readonly" placeholder="To Date" style="display: none; width: 78px; line-height: 25px; ">
</div>
</div>
</div>

可以看出,我已经划分了row <div>6-6 .当我将屏幕缩小到小尺寸时,div 将如附图所示显示。当屏幕处于 XS 时,我希望删除多余的空间或 SM模式。 2nd line in image is what i want

最佳答案

你可以这样做:

<div class="row row-no-padding" style="padding-top:10px;">

.row-no-padding [class*="col-"] {
padding-left: 0 !important;
padding-right: 0 !important;
}

或者只针对 xs/sm:

.row-no-padding [class*="col-xs"],
.row-no-padding [class*="col-sm"] {
padding-left: 0 !important;
padding-right: 0 !important;
}

关于c# - 删除 div 之间的间距,bootstrap,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30930932/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com