【问题标题】:How to left and right align text in multiple select option in Bootswatch如何在 Bootswatch 中的多选选项中左右对齐文本
【发布时间】:2019-03-27 15:09:21
【问题描述】:

我正在使用 Bootswatch Sandstone https://bootswatch.com/sandstone/

我有一个带有源代码的表单:

<div class="form-group">
  <label for="exampleSelect2">Example multiple select</label>
  <select multiple="" class="form-control" id="exampleSelect2">
    <option><p class="text-left">Subject 1<p><p class="text-right">500 views</p></option>
    <option><p class="text-left">Subject 2<p><p class="text-right">400 views</p></option>
  </select>
</div>

如何在选项中左右对齐文本值?

【问题讨论】:

    标签: forms text bootstrap-4 alignment bootswatch


    【解决方案1】:

    据我所知,选项标签内不可能有不同的格式。您可以使用的一个选项是使用 title 属性将信息显示为工具提示,如下所示:

    <div class="form-group">
      <label for="exampleSelect2">Example multiple select</label>
      <select multiple="" class ="form-control" id="exampleSelect2">
        <option title="500 views">Subject 1</option>
        <option title="400 views">Subject 2</option>
      </select>
    </div>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-05-29
      • 2012-10-30
      • 2014-04-17
      • 2014-12-12
      • 1970-01-01
      • 2015-04-24
      • 2017-06-25
      相关资源
      最近更新 更多