在一个![Normal caret on the first line](https://dzwonsemrish7.cloudfront.net/items/0O3W2I1t0J3f2g2S3U1g/Screen%20Shot%202012-10-23%20at%2016.45.13.png)
您可以在此处查看此行为的演示:http://jsfiddle.net/sGgVR/
编辑:测试使用的浏览器是Safari 6.0.1和Chrome 22.0.1229.94
contenteditable
的div中使用line-height
属性会导致插入符号移动到第二行时出现向下偏移的情况。虽然使用像Arial这样的标准字体也会发生这种情况,但使用自定义Web字体更加明显。有没有一种方法可以解决这种行为问题呢?
以下图片展示了第一行和第二行上的插入符
![Normal caret on the first line](https://dzwonsemrish7.cloudfront.net/items/0O3W2I1t0J3f2g2S3U1g/Screen%20Shot%202012-10-23%20at%2016.45.13.png)
![Shifted caret on the second line](https://dzwonsemrish7.cloudfront.net/items/3N2V2W1A1m1k3s440x3E/Screen%20Shot%202012-10-23%20at%2016.46.00.png)
line-height
CSS 对此没有影响。 - Kevin Boucher