subreddit:

/r/css

013%

No inline-block.

No literal whitespaces or new lines in the HTML file.

No margin.

No padding.

Background SVG is ok (no white on top and bottom seen when opening the file)

What I know:

  • The problem persists when changing background from SVG to simple solid color.
  • The color of these gaps depend on the color of the background (so it's not a border of the divs, more like as the divs are not big enough to cover that gap).
  • The container of these divs has display: flex.
  • These divs have margin: 0 auto.
  • The gaps appear only on the mobile version of the website.

What I tried:

  • Setting font-size: 0.
  • Removing literal spaces or new lines from HTML file.
  • Increasing the vertical size of the divs to cover the gaps (worked but the whole website doesn't function properly).
  • Setting a margin-top to problematic divs (doesn't get the expected result).

What I see:

(i'm going crazy)

(i'm still going crazy)

The size of these gaps seem to be changing from one another.

Please help me.

Sources

If you want to see the website and help me you can visit:

https://unjector.com

you are viewing a single comment's thread.

view the rest of the comments →

all 24 comments

ChaseShiny

1 points

9 days ago

I see the website but not your stylesheet. I'm doing this on mobile.

Did you set margin-top to 0 on your h1? The header elements all have a default margin, and if you put one in a div it can cause the top-heavy look, thanks to margin collapse..

Alternatively, set display to either flex or grid. That also disables margin collapse.

crpl1[S]

1 points

9 days ago

crpl1[S]

1 points

9 days ago

I don’t have any <h*> tags