Is there a way to change the height of the text selection highlight without changing the line-height
of the element that contains it?
Thanks.
Is there a way to change the height of the text selection highlight without changing the line-height
of the element that contains it?
Thanks.
If you want to do this with CSS only the the answer is NO.
Only a small subset of CSS properties can be used in a rule using ::selection in its selector: color, background, background-color and text-shadow. Note that, in particular, background-image is ignored, like any other property. https://developer.mozilla.org/en-US/docs/CSS/::selection
© 2022 - 2024 — McMap. All rights reserved.
line-height
? – Retral<p> Lorem ipsum (screen is as wide as to contain only these words) dolor sit amet </p>
Now if I selectLorem ipsum
selection is let's say 10px tall. If I select dolor sit amet or any of the following text, it is 20px tall. If I set the line-height of the first line of the paragraph to 3em highlight is ok. – Rebeckarebekafont-size
. Theline-height
does not change the selection square. It depends on em size of the font? -- rhytorical question – Doubletime