【问题标题】:CSS adjacent selector nestedCSS相邻选择器嵌套
【发布时间】:2019-05-05 06:07:44
【问题描述】:

Bootstrap 按钮块使用相邻的选择器来划分按钮。

.btn-block + .btn-block {
    margin-top: 5px;
}

我有一个圆顶树,我的引导 btn 块将嵌套在垫片中。如何使用 Bootstrap 使用的相同邻接规则为我的元素创建边距?

   <div class="col-md-4">
<span id=" "><input type="hidden" name=" " id=" ">
    <input type="submit" name=" " value=" " onclick=" " id=" " class="btn btn-primary btn-block"></span>
<span id=" "><input type="hidden" name=" " id=" ">
    <input type="submit" name=" " value=" " onclick=" " id=" " class="btn btn-primary btn-block">
</span>
<input type="submit" class=" btn-block btn btn-primary">
<input type="submit" id="ctl00_ctl00_cpContent_cpDetails_efvOrder_tslUsers_btnClear" class=" btn-block btn btn-primary">
</div>

【问题讨论】:

    标签: css twitter-bootstrap-3 styles


    【解决方案1】:

    如果我理解正确,您将在另一个元素内有一个引导按钮。所以你可以做的是给每个容器元素一个类,比如btn-container

    然后您可以使用子选择器.btn-container &gt; .btn-block { 为其提供所需的样式。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-10-16
      • 1970-01-01
      • 2017-03-20
      • 1970-01-01
      • 2014-08-05
      • 1970-01-01
      • 2011-10-30
      • 1970-01-01
      相关资源
      最近更新 更多