如何从容器中移除空格?

huangapple go评论63阅读模式
英文:

How can I remove spaces from the container?

问题

<div class="container-fluid bg-image w-100" style="background:rgb(201, 188, 188);">
    <div class="text-center display-3 pt-5">
        <p>What We Do</p>
    </div>
    <p class="text-center pt-2" style="padding-right:20%; padding-left: 20%;">Lorem ipsum dolor sit amet consectetur adipisicing elit. A veniam totam eaque praesentium excepturi voluptas suscipit dicta, blanditiis repudiandae error! Quia dignissimos obcaecati vero illum optio ducimus iure assumenda earum hic soluta ratione voluptas laudantium quasi incidunt maxime, autem vel repellendus enim. Maiores enim assumenda fugiat dicta distinctio, a neque.</p>
    <div class="text-center pt-2 pb-2"><img src="./img/03.png" alt="" style="width: 50%;"></div>
    <p class="text-center pt-5 pb-5">Images from <span style="text-decoration: underline">Freepik</span></p>
</div>
英文:

first picture
second picture

I'm just learning how to use Bootstrap. On the first picture everything is good, because on the background is the picture. But on the second picture I have margins, and it is background color. How remove margins?
Here a code of the second one:

&lt;div class=&quot;container-fluid bg-image w-100&quot; style=&quot;background:rgb(201, 188, 188);&quot;&gt;
                &lt;div class=&quot;text-center display-3 pt-5&quot;&gt;
                    &lt;p&gt;What We Do&lt;/p&gt;
                &lt;/div&gt;
                &lt;p class=&quot;text-center pt-2&quot; style=&quot;padding-right:20%; padding-left: 20%;&quot;&gt;Lorem ipsum dolor sit amet consectetur 
                    adipisicing elit. A veniam totam eaque praesentium excepturi voluptas suscipit dicta, 
                    blanditiis repudiandae error! Quia dignissimos obcaecati vero illum optio ducimus 
                    iure assumenda earum hic soluta ratione voluptas laudantium quasi incidunt maxime, 
                    autem vel repellendus enim. Maiores enim assumenda fugiat dicta distinctio, a neque.&lt;/p&gt;
                &lt;div class=&quot;text-center pt-2 pb-2&quot;&gt;&lt;img src=&quot;./img/03.png&quot; alt=&quot;&quot; style=&quot;width: 50%;&quot;&gt;&lt;/div&gt;
                &lt;p class=&quot;text-center pt-5 pb-5&quot;&gt;Images from &lt;span style=&quot;text-decoration: underline&quot;&gt;Freepik&lt;/span&gt;&lt;/p&gt;
            &lt;/div&gt;

答案1

得分: -3

尝试将此内容用于 CSS 样式中的 bg-image 类。

{
  padding : 0 !important;
  margin : 0 !important;
}
英文:

Try using this in bg-image class in css styling.

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-css -->

{
  padding : 0 !important;
  margin : 0 !important;
}

<!-- end snippet -->

huangapple
  • 本文由 发表于 2023年5月8日 02:46:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/76195716.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定