Gap between divs...
I made a div container with border in that div I made another div with background color. Between those 2 divs there is a tiny tiny gap. Margin: -2px; fixes it. Can anyone explain me why is this happening ? I even removed all my css that affects layout like margins or paddings, tried to set them to 0 and it didn't work. :/
34 Replies
How can there be a gap between parent div and child div without margin and padding LOL
Do you have other content inside that inner div?
please share some more code html/css. preferably in a codepen (https://pen.new)
https://codepen.io/LCSNeo/pen/xxjpKME
I also have the reset.css but it shouldn't affect it.
can not see a gap
Really ? I can clearly see it on chrome
not in firefox or chrome
the Fudge š
what is going on with my chrome
are you zoomed?
No
so not zoomed in or out? (try
ctrl+0
)If I zoom in to 125% the gap disappears but at 100% still exists and yes I did use
ctrl+0
the code is correct, so no worry about that. but what is happening with your browser ? I don't know
Good question
I would that the localhost apache server messing up but its not just in localhost
hm, maybe someone else has an idea
Hopefully
whats your monitor's resolution? (both of you)
i own a UHD display and i sometimes have very thin lines flashing similar to that, if i overlay some divs with the same dimensions but different colors. or if i build a 3d cube with skew and rotate.
it's almost like half a pixel or less seemingly not lining up. disappears when zooming
yea, pixel density could be an issue. but on 100% it are whole pixels (all the values are px or em). So default should be okay
hmm, is it getting better if you turn off windows' scaling?
sadly it does LOL but then everything on my screen is just for ants to read š
lol, i run my uhd at 100%
so it definitely seems like a scaling/pixel density problem
I can barely read it anything
100%
vs
125%
hehe, but yeah, it's just a display error. nothing wrong with your code
But.. it irritates me
š
nothing i can do lol
i think you can scale only text in "advanced scaling settings" (im on windows 11 so i can not check)
yep, discord has text scaling
oh, misinterpreted that
you mean in windows
can confirm for 10
There is only custom scaling I will try that
do you have Accessibility > text size?
Found it. Thank you. Now to adjust it. No wonder I was going crazy multiple times thinking my code is bad.