empty pseudo. doubt regarding padding inherit
I'm testing with the :empty pseudo and tried giving it
padding: inherit
, it works the same as padding: 0
. where is this padding being inherited from? I'm not using any resets https://codepen.io/kaedaDante/pen/BaxwMjx5 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
in this case div.error:empty inherit looks at it's parent div. That doesnt have a padding set, so it will default to zero
Instead of removing the padding from an empty error, you could just only style the
.error
when it is :not(:empty)
although i haven't set explicitly set a padding, there is a default padding/margin right?
or will it only inherit if i set a padding/margin by myself?
no, divs have no default paddings/margins
oh, in that case, this makes sense
thanks for this!