How do you style the caret for a contenteditable div when there is no text in the div.
Before text is entered:
After text is entered:
Notice how the caret on the before shot is up against the top of div, not vertically-centered like it is once text is entered. I know you can prepopulate the div with <br>
before and it fixes it but I'm hoping there is a better solution. This is a minor thing that has been bugging me for a while.
I found the problem, you can't use
line-height
. You need to usepadding
. Here's the difference http://jsfiddle.net/frcso1n9/1/HTML
CSS