Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

301
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!