Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

302
Visualizações
How to remove this weird dashed gap in ReactJS with Bootstrap

I'm building an app using NextJS - Bootstrap, when I check the elements tab, I see this weird dashed gap on the top of the screen. There is no element that has margin/padding-top at all It's not clickable at all.

Seems like the element with the d-flex class (flex element) has this weird dashed gap. But when I check the elements, this flex element does not any padding or margin.

enter image description here

In the above picture, there is an image at the top. By default, it should be positioned at the top of the screen. But somehow, there is this dashed gap. I can't use negative margin-top values on the image because it won't be the same for all resolutions, it'll break the responsiveness of the app.

I tried margin: 0 and padding: 0 for almost every component at the top (wrapper divs, the Image component, Html, body, etc.) nothing works.

Why there is this gap and where does it come from?

Edit: After comments, here are the related CSS parts

This is the parent element (using Bootstrap class d-flex, it's on the picture above)

.main-all-wrapper {
  max-width: 100%;
  height: 100vh;
}

This is the image element

.main-image-wrapper {
  width: 100%;
  height: 60%;
  max-width: 800px;
  max-height: 650px;
  position: relative;
}

Body and HTML

HTML,
body {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  height: 100%;
about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

The div with class d-flex has property justify-content: center from the look of the class justify-content-center, and flex-direction: column from the look of flex-column class which results in your content pushed to the center vertically if there is available space. You should instead use the class justify-content-between instead of justify-content-center which will push the image to the top and have the remaining space shared in between the flex child.

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda