Whenever I click inside this div for the first time, my cursor goes up. But when I start typing, the text appears correctly in the middle of the div. How can I resolve this issue with the placeholder not aligning properly? I want the cursor to be positioned in the middle initially, similar to how text is displayed as you type.
Here is a demo http://jsfiddle.net/0gr09835/2/, along with the relevant snippet:
[contenteditable=true]:empty:before {
content: attr(placeholder);
display: block; /* For Firefox */
}
[contenteditable=true]:empty:focus:before {
content: "";
}
Below is my screenshot: https://i.sstatic.net/Cbt6f.png
This behavior works fine in Chrome, but not in Firefox.