【问题标题】:Bootstrap: Row margins seen on smaller devicesBootstrap:在较小的设备上看到的行边距
【发布时间】:2017-06-03 00:47:31
【问题描述】:

我的作品集网站使用行来显示全角图像。这些在我的桌面和 ipad 上看起来不错,但在手机上查看后,左右两边似乎有边距。

代码如下:

<section class="no-padding" id="portfolio">
    <div class="container-fluid">
        <div class="row no-gutter">
            <div class="col-xs-12">
               <img src="img/focus.jpg" class="img-responsive" alt="Focus Ireland"></a>
            </div>
        </div>   
     </div> 
</section>  

该网站位于http://www.burnser.com/index.html

任何帮助将不胜感激。提前致谢。

【问题讨论】:

标签: html css twitter-bootstrap web


【解决方案1】:

Bootstrap 的 col-xs-12 类有一个填充。

padding-right: 15px;
padding-left: 15px;

在大于 768 像素的屏幕中,该填充设置为 0。

因此,如果您想删除填充,您可以在您的 css 文件中覆盖这些属性。

【讨论】:

    【解决方案2】:

    需要改变

    .col-xs-12{
        padding-right: 15px;
        padding-left: 15px;
    }
    

    .col-xs-12{
            padding-right: 0;
            padding-left: 0;
        }
    

    目前只为min-width: 768px设置

    @media (min-width: 768px)
    .no-gutter > [class*=col-] {
        padding-right: 0;
        padding-left: 0;
    }
    

    【讨论】:

    • @Brain 我只是在问这个问题,你有没有注意到你的一些文字在这样做之后变得有点混乱,就像看到 About 小屏幕中的内容
    • 是的,我刚刚注意到,现在他需要为图像创建单独的class
    猜你喜欢
    • 2021-11-19
    • 1970-01-01
    • 1970-01-01
    • 2015-10-31
    • 2016-08-29
    • 1970-01-01
    • 2020-05-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多