Height of after pseudo-element not matching original height of element acting upon

Hello guys, sorry to disturb you all; can someone explain why the height of my after pseudo-element is not the same as the height of my li block even though height has been set to 100% please, here is my codepen: https://codepen.io/Fakeur/pen/poMWrbz
Fakeur
CodePen
Untitled
...
7 Replies
capt_uhu
capt_uhu2mo ago
looks like it's from the margin-bottom: 20px; on your link element?
Faker
FakerOP2mo ago
hmm but how would margin affects the height here please
capt_uhu
capt_uhu2mo ago
the margin-bottom on the a is adding to the overall height of the li
Faker
FakerOP2mo ago
yeah I remove it and see, all works fine but I'm still confuse, why adding margin-bottom caused that? Also, was it possible to know that using the dev tools please
capt_uhu
capt_uhu2mo ago
yep, dev tools is how I found it. The margin gets highlighted a different color than the rest of the element when you inspect it.
Faker
FakerOP2mo ago
hmm here's what I have
No description
capt_uhu
capt_uhu2mo ago
the margin is the transparent orange-ish color. It looks like you moved it to the li
Want results from more Discord servers?
Add your server