10 Replies
If I remove
position: relative;
from .parent
, the border fills the entire screen.
I wanna understand this css, why removing both position:relative
from .parent
and position:absolute
from .parent::after
makes this border invisible ?I don't have time to look into it, but that's probably to do with stacking contexts: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_positioned_layout/Understanding_z-index/Stacking_context
it's not related to this
because if you remove the position body becomes the containing block for your after
Good call Mannix. That's the one I meant yeah https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block. Serves me right for looking too quickly
which position ? relative or absolute ?
relative
position absolute always looks for first instance of position relative if there isn't one body becomes the containing element
I didn't understand. Could you please elaborate?
or give me some resource to study more about this
the second link I shared has a lot of info
okay thanks