Abd
Abd

Reputation: 175

emojis are causing change in line height

<p>Alternatively, you can use percentages, which
   will be calculated with respect to the width of the generated box's
   containing block. &#128517;Therefore, assuming the container's width
   is greater than the image's height, margin: -50% 0 should be enough.
   Hide code snippet
</p>

emoji increases line heightHow to avoid change in line-height on insertion of emojis?

Upvotes: 2

Views: 1498

Answers (2)

Alan Yu
Alan Yu

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

Kameron
Kameron

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. &#128517;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

Related Questions