Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 引导4移动flexbox太宽_Html_Css_Twitter Bootstrap_Bootstrap 4 - Fatal编程技术网

Html 引导4移动flexbox太宽

Html 引导4移动flexbox太宽,html,css,twitter-bootstrap,bootstrap-4,Html,Css,Twitter Bootstrap,Bootstrap 4,所以我的问题是我的代码: <div class="row"> <div class="w-100 col-auto col-lg-5 w-auto p-3 p-lg-5 m-4 rounded-sm bg-dark text-white shadow-lg"> <h3>This is a very very very long Text</h3> </div> </div> 这是一篇很长

所以我的问题是我的代码:

<div class="row">
    <div class="w-100 col-auto col-lg-5 w-auto p-3 p-lg-5 m-4 rounded-sm bg-dark text-white shadow-lg">
         <h3>This is a very very very long Text</h3>
    </div>
</div>

这是一篇很长的文章
结果如下:

这个专栏对于我的手机(或者在本例中是Firefox)来说太宽了,我想这是因为页边空白和填充


有没有办法避免这种情况?

添加flex-shrink-1和flex-grow-1。它应该可以工作。

添加flex-shrink-1和flex-grow-1。它应该会起作用

最好的方法是,不要试图将自定义类或任何其他类应用于flex布局或引导的专用类


不要在col bcz中使用边距,因为它们具有预先定义的宽度。宽度自动获取宽度,直到其内容


这是一篇很长的文章
最好的方法是,不要试图将自定义类或任何其他类应用于flex布局或引导的专用类


不要在col bcz中使用边距,因为它们具有预先定义的宽度。宽度自动获取宽度,直到其内容


这是一篇很长的文章

m-4是问题所在…&w-100对于100%或100px不使用colm-4中的余量是问题…&w-100表示100%或100px不使用列中的边距
 <div class="row">
   <div class="col-lg-5 p-lg-5">
    <div class="w-auto p-3 m-4 rounded-sm bg-dark text-white shadow-lg">
         <h3>This is a very very very long Text</h3>
    </div>
   </div>
  </div>