0

I'm building component banner in my nuxt.js.

I tried a lot of way to solved this problem but it still not solved yet, i tried to add margin:0; and padding:0; in my html and body tag but the white space is still there. I tried another solution in this topic about using-100vw-and-vh-creates-extra-space-beyond-viewport-size-how-do-i-get-rid-of but when I try it the result is still the same. I try this topic too about 100vw-causing-horizontal-overflow-but-only-if-more-than-one but there is no luck.

this is my banner component:

<template>
  <div id="paham-banner-career">
    <div class="banner-container">
      <h2>Let's See Where You Fit In</h2>
    </div>
  </div>
</template>

this is my css:

<style lang="css" scoped>
#paham-banner-career{
    font-family: "Nunito", sans-serif;
    background-color: #3b73c5;
    width: 100vw;
    max-width: 100%;
}

#paham-banner-career .banner-container{
    margin: 100px auto;
    padding: 25px 0px;
    text-align: center;
    max-width: 1200px;
}

#paham-banner-career h2{
    color: #ffffff;
    font-size: 2.5em;
    font-weight: bold;
}
</style>

can someone save me to solve this?

this is what I got right now there is extra white space that I mark

Rakish Frisky
  • 665
  • 7
  • 23

1 Answers1

0

try adding box-sizing

<style lang="css" scoped>

*{box-sizing: border-box;}

#paham-banner-career{
    font-family: "Nunito", sans-serif;
    background-color: #3b73c5;
    width: 100vw;
    max-width: 100%;
}

#paham-banner-career .banner-container{
    margin: 100px auto;
    padding: 25px 0px;
    text-align: center;
    max-width: 1200px;
}

#paham-banner-career h2{
    color: #ffffff;
    font-size: 2.5em;
    font-weight: bold;
}
</style>
Sumit Patel
  • 4,530
  • 1
  • 10
  • 28