【问题标题】:How to make a section with image and text side by side如何并排制作带有图像和文本的部分
【发布时间】:2019-10-02 00:25:06
【问题描述】:

如何在引导程序中创建这样的部分Image 1

【问题讨论】:

  • 欢迎来到 SO。请提供您的代码并解释什么不起作用。见How to ask

标签: html css bootstrap-4


【解决方案1】:

您最常使用引导网格也用于文本网格中顶部的空间,您需要使用padding-top 属性

<div class="row">
<div class="col-lg-6" style='padding-top: 50px;'>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
</div>
<div class="col-lg-6" style="background-image: url('/images/bg.png')">
</div>
</div>

我也建议你阅读这篇文章以了解不同的大小:https://codepen.io/team/MedTouch/full/YqBJzv

【讨论】:

    【解决方案2】:

    您可以使用引导程序。

    <div class="row">
    <div class="col-md-6 bg-grey">
    ....Your text here
    </div>
    <div class="col-md-6" style="background-image: url('/images/bg.png')">
    </div>
    </div>
    

    取决于您的屏幕截图,此代码可能会有所帮助

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-08-09
      相关资源
      最近更新 更多