Reputation: 175
<p>Alternatively, you can use percentages, which
will be calculated with respect to the width of the generated box's
containing block. 😅Therefore, assuming the container's width
is greater than the image's height, margin: -50% 0 should be enough.
Hide code snippet
</p>
How to avoid change in line-height on insertion of emojis?
Upvotes: 2
Views: 1498
Reputation: 1542
Set CSS property line-height to 1.2em could set the p tag to default height
p {
line-height: 1.2em;
}
Upvotes: 3
Reputation: 10846
You can set a fixed line-height
like so:
p {
line-height: 20px !important;
}
<p>Alternatively, you can use percentages, which
will be calculated with respect to the width of the generated box's
containing block. 😅Therefore, assuming the container's width
is greater than the image's height, margin: -50% 0 should be enough.
Hide code snippet
</p>
Upvotes: 6