【问题标题】:need img on left but bootstrap defaults it to centre左侧需要img,但引导程序默认将其居中
【发布时间】:2017-05-20 05:38:50
【问题描述】:

我需要将图像向左对齐,但 css bootstrap 会自动将其对齐到中心。如何解决?

    <div class="container">
        <div class="row">
            <div class="col-md-6 img-left"></div>
            <a href="http://placehold.it"><img src="http://placehold.it/150x150" alt="this is the portfolio main photo"></a>
            <div class="col-md-6 text-right text-uppercase">
                <h1>Bruno</h1>
                <h4>The SAVIOR</h4>
            </div>
        </div>
    </div>

the problem

【问题讨论】:

    标签: html css web-development-server


    【解决方案1】:

    我认为您需要在结束锚标记之后关闭包含图像/锚的 div。像这样:

    <div class="col-md-6 img-left">
    <a href="http://placehold.it"><img src="http://placehold.it/150x150" alt="this is the portfolio main photo"></a>
    </div>
    

    我无法实际测试,但试一试,我认为它应该可以解决您的问题。

    【讨论】:

      【解决方案2】:

      看起来你正在关闭标签,在图像之前左对齐。

      <div class="col-md-6 img-left">
              <a href="http://placehold.it"><img src="http://placehold.it/150x150" alt="this is the portfolio main photo"></a>
      </div>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2020-10-26
        • 1970-01-01
        • 1970-01-01
        • 2017-06-22
        • 2019-10-09
        • 1970-01-01
        • 2016-02-01
        相关资源
        最近更新 更多