Can you explain how the baselineTrim functions? #60
|
I think I understand roughly what's going on with most of the calculations, but the Thanks. |
Answered by
michaeltaranto
Dec 4, 2021
Replies: 1 comment 1 reply
|
Best way to look at this is a quick demo. Using html nodes to replicate the pseudo elements, you can see that without the The display table technique is also being used to prevent margin collapse resulting in unexpected outcomes when using background colours. Hope that helps |
1 reply
Answer selected by
dabrahams
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Best way to look at this is a quick demo.
Using html nodes to replicate the pseudo elements, you can see that without the
marginTopon theafterthe following node is not pulled up to the baseline of the cropped text node.The display table technique is also being used to prevent margin collapse resulting in unexpected outcomes when using background colours.
Hope that helps