How can I avoid a highlight overlap when I select the text that has a line-height lower than the font-size?
Example:
*::selection {
background-color: grey;
}
p {
font-size: 24px;
line-height: 20px;
}
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
The only way I've been able to solve this is by making the background-color transparent and just changing the text color. I'd like to still have the background color though.
Example
*::selection {
background-color: transparent;
color: red;
}
p {
font-size: 24px;
line-height: 20px;
}
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>

