开发者

Text overflow even with vertical-align: top

开发者 https://www.devze.com 2023-02-10 18:33 出处:网络
If you take a look at this screenshot: http://img687.imageshack.us/img687/4350/photobenchmozillafirefo.png

If you take a look at this screenshot: http://img687.imageshack.us/img687/4350/photobenchmozillafirefo.png

You can see the text on the top right overflow the div. Eventhough I have placed vertical-align: top in there it still won't stick on开发者_运维百科 the top. How do I make this text appear on the top?


It is at the top. Only the top for a font doesn't necessarily have to be the top visible pixel of a character. Trying to draw it even higher will force you to set the line height smaller than the font size, or set a negative margin. Both solutions may cause the text to be cut off on another computer and/or browser.


You should set line-heigth for the text.

0

精彩评论

暂无评论...
验证码 换一张
取 消