Background image is creating unnecessary gap at different screen size in different way

亡梦爱人 提交于 2019-12-23 04:59:10

问题


Randomly a gap is creating at different screen size below two image.I have tried to solve this problem for 2/3 days.But failed every time.Please help me to solve this problem.Related codes are given below image.

Problem at midium screen size:

Problem at large screen size:

HTML:

<div class="section-three">
        <div class="container-fluid">
            <div class="row">
        <!---------------------- Left-Area -------------------> 
                <div class="s3-left col-sm-8">
                    <a href="#"><img src="images/logo4.png" alt="logo" class="img-responsive center-block"/></a>
                </div>
        <!-----------------------Right-Area ------------------->    
                <div class="s3-right col-sm-4">
                    <div class="container-fluid">
                        <div class="s3-right-up row">
                            <div class="container-fluid">
                                <div class="s3-logo row">
                                    <a href="#" target="_self">
                                        <img src="images/logo3.png" alt="logo" class="img-responsive center-block" style="width:32px; height:auto;"/>
                                    </a>
                                </div>
                                <div class="s3-heading row">
                                    <h5 class="text-uppercase text-center"> Vintage oliva </h5>
                                </div>  
                                <div class="s3-description row">
                                    <div class="gap">
                                        <p class="text-justify">
                                            Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived.
                                        </p>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="s3-right-down row">
                            <div class="container-fluid">
                                <div class="s3-image row">
                                    <img src="images/background3.jpg" alt="logo" class="img-responsive"/>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

CSS:

.section-three .s3-left.col-sm-8 {
    padding-left: 0 !important;
    padding-right: 0 !important;
}
.s3-left {
    background: url("images/background2.jpg") no-repeat 0 0 / 100% 100%;
}
.s3-left img {
    width: 92px;
    padding: 199px 0;
}
.s3-image img {
    width: 100%;
}
.s3-logo {
    padding: 48px 0 25px;
}
.s3-heading h5 {
    margin: 0;
    padding: 0 0 10px;
}
.s3-description .gap {
    width: 80%;
    margin: auto;
}
.s3-description p {
    font-size: 12.4px;
    padding-bottom: 58px;
}

回答1:


Try setting the background-size to cover:

.s3-left {
    background: url("images/background2.jpg") no-repeat 0 0 / 100% 100%;
    background-size: cover;
}


来源:https://stackoverflow.com/questions/32017710/background-image-is-creating-unnecessary-gap-at-different-screen-size-in-differe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!