【问题标题】:Changing a bootstrap template that already has a div container and div row更改已经具有 div 容器和 div 行的引导模板
【发布时间】:2020-10-18 02:31:40
【问题描述】:

我正在尝试使用基本引导模板,我添加了一个:

<div class="container"><div class="row">
    <div class="col-md-6">
        <p>This is the text I would like to align left</p>. 
    </div>
</div>

但是,我使用的引导模板具有文本中心对齐 - 如何仅为该段落添加规则以左对齐? (它会在哪里和叫什么?) 我应该补充一点,我有一个网站的 css 文档,不能添加到主类 - 我需要为这个区域制定规则。

【问题讨论】:

    标签: html css templates


    【解决方案1】:
    <div class="container">
      <div class="row">
        <div class="col-md-6">
           <p class = "text-left">This is the text I would like to align left</p>
        </div>
      </div>
    </div>
    

    使用它会对齐左侧。 (class= 段落标签上的“text-left”)。

    【讨论】:

      【解决方案2】:

      你忘了关闭你的行 div 也应该像这样使用 "text-left" 类:

      <div class="container">
          <div class="row">
              <div class="col-md-6">
                  <p class="text-left">This is the text I would like to align left</p>. 
              </div>
          </div>
      </div>
      

      【讨论】:

        猜你喜欢
        • 2021-01-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-10-07
        • 1970-01-01
        • 1970-01-01
        • 2017-04-18
        • 1970-01-01
        相关资源
        最近更新 更多