Answer the question
In order to leave comments, you need to log in
Is it possible to change the height of the selection in an input?
Is it possible and how to change the height of the text selection (yellow) using css?
Or just change the height of the characters directly in the font (adding white space above and below)?
Answer the question
In order to leave comments, you need to log in
Unfortunately, when calculating the dimensions of the ::selection pseudo-element, the line-height-to-font-size ratio hardwired into the font is taken into account.
You can change the line-height to your heart's content, but nothing will change for this pseudo-element. The only rules available are color , background-color , in most modern browsers text-shadow .
Apparently, there is still no consensus on the selected fragment, because even in the specification section 7.3 is left empty
This section intentionally left blank. (This section previously defined a ::selection pseudo-element.)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question