如何在HTML和CSS中删除图像和资源管理器中的“空白”

问题描述 投票:0回答:3

我正在使用bootstrap,图像之间有这个空白,我似乎无法删除

我已经尝试将最大宽度,对象适合和浮动设置为左,并删除填充

<style>
    body {
        font-family: Arial, Helvetica, sans-serif;
        background-color: white;
    }
    .top {
        position: absolute;
        top: 0;
    }
    .imageStyle{
        height: 100%;
        width: 100%;

    }
    .c {
        background-color: black;
    }
</style>
    <div class="container-fluid top">
        <div class="row">
            <div class="col-7">
                    <img src="Images/Background.png" align="left" class="img-fluid float-left imageStyle back">
            </div>
            <div class="col-5 c">
            </div>           
        </div>
    </div>
html css image whitespace
3个回答
0
投票

好吧,Bootstrap的qazxsw poi类有内置填充(qazxsw poi,qazxsw poi)。您可以通过在col-* div上指定类padding-left: 15px **来删除该填充。

**设置padding-right: 15pxpx-0

看到这里:col-7


这是您的问题的根源还是您还有其他想法?


0
投票

将*添加到你的css中它选择DOM中的所有元素然后通过添加填充来删除填充和边距:0;和margin:0;,尝试用div标签替换img标签,然后将背景图像添加到css中。

padding-left: 0
padding-right: 0

0
投票

我在bootstrap中使用了no-gutters类

© www.soinside.com 2019 - 2024. All rights reserved.