Separated space between sections

Separated space between sections
0

#1

Hi fellas, i can’t seem to understand why there’s a white space between sections like this. I use background image for each sections.


#2

Maybe you can provide a codepen, It’s highly impossible to sort it out by seeing the screenshot


#3

@GeraldVu103,

as @Sujith3021 recommended, showing us some code can be of great assistance.

Furthermore, I would recommend using the Chrome Developer Tools.
It will allow you to see the elements of your HTML markup and understand why there is space between the sections.

My guess? You have surrounded each section element with a div element and maybe that is what is causing the space.


#4

here is my html

<section id="home-section" class="hero fading-section">
            <div class="content" id="content-home">   
                <h2>Bookingland</h2>
                <h1>Flexible services for homestay.</h1>
                <a href="#">
                    <button id="button-join">Join now</button>
                </a>
            </div>
        </section>
        <section id="about-section">
            <div class="content"> 
                
            </div>

        </section>

css part:

.hero {
    overflow: hidden;
    text-align: center;
    color: #fff;
}

#home-section {
    background: url(/img/beach-clouds-daytime.jpg);
    background-repeat: no-repeat;
    background-size: cover;
    width: 100%;
    height: 900px;
    opacity: 0.9;
}
.content {
    overflow: hidden;
    margin: 10em 10em 0 10em;
    padding: 5%;
   }
#content-home {
    animation-name: slidein;
    animation-duration: 5s;
    animation-fill-mode: forwards;

}
#about-section {
    background: url(/img/architecture-background-buildings.jpg);
    background-repeat: no-repeat;
    background-size: auto 75em;
    width: 100%;
    height: 800px;
    opacity: 0.9;
}

#5

i have used chrome dev tools but in this case it just couldn’t help


#6

You have set margin in your.content class inside #about-section, remove the top margin


#7

thank you so much! sometimes a little stupid mistake makes me baffled


#8

Yep, it happens.! :wink: