Skip to content

Can you explain how the baselineTrim functions? #60

Answered by michaeltaranto
dabrahams asked this question in Q&A
Discussion options

You must be logged in to vote

Best way to look at this is a quick demo.

Using html nodes to replicate the pseudo elements, you can see that without the marginTop on the after the 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

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dabrahams
Comment options

Answer selected by dabrahams
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants