【问题标题】:Styling issues with <legend> tag and grid system in bootstrap 4bootstrap 4 中 <legend> 标记和网格系统的样式问题
【发布时间】:2017-09-11 15:32:34
【问题描述】:

应该是这样显示的:

而是以这种方式显示:

看到fruit这个词不对齐。

我正在使用 Bootstrap 4 alpha v6。这是代码

<fieldset class="form-group row">
    <div class="col-sm-3"><legend class="col-form-legend">Fruit</legend></div>
    <div class="offset-sm-3 col-sm-9">
        <div class="form-check row">
            <label class="form-check-label">
                <input class="form-check-input" type="radio" name="legendradio" id="legendradio1" value="1">Apple
            </label>
        </div>
        <div class="form-check row">
            <label class="form-check-label">
                <input class="form-check-input" type="radio" name="legendradio" id="legendradio2" value="2">Orange
            </label>    
        </div>
        <div class="form-check row">
            <label class="form-check-label">
                <input type="radio" class="form-check-input" name="legendradio" id="legendradio3" value="1">Watermelon
            </label>
        </div>
    </div>
</fieldset>

【问题讨论】:

    标签: css twitter-bootstrap bootstrap-4 twitter-bootstrap-3


    【解决方案1】:

    通过添加一个类来填充以下 html 元素:

    <div class="col-sm-3 padding"><legend class="col-form-legend">Fruit</legend></div>
    

    <fieldset class="form-group row padding">
    

    CSS: .padding { padding:Npx }

    【讨论】:

      猜你喜欢
      • 2018-03-03
      • 2018-09-03
      • 2018-12-30
      • 1970-01-01
      • 2019-11-22
      • 2016-12-05
      • 2018-11-30
      • 2014-01-10
      • 1970-01-01
      相关资源
      最近更新 更多