When working in a contenteditable div, I am utilizing line-height to create some spacing between lines. The following example illustrates the issue:
<div style="padding: 50px; width: 90px; line-height: 2em;" contenteditable="true">
line height line height line height
<span style="line-height: 1em; color: Red;">line height</span>
<span style="line-height: 10px; color: Orange;">line height</span>
<span style="line-height: normal; color: Green;">line height</span>
<span style="line-height: .5em; font-size: .5em; height: 5px; color: Blue;">line height</span>
</div>
In Chrome, the height of the caret increases when moved to the second line. Despite the presence of various spans in the div with different line heights, the caret height remains unaffected.
A similar issue is observed in Safari. However, in Firefox, the caret height corresponds to the font size rather than the line height.
Are there any suggested solutions to address this problem in Chrome and Safari?