开发者

CSS Line Height and Padding

开发者 https://www.devze.com 2023-03-10 22:43 出处:网络
I have a box that is 300px wide and 30px high.I have text that wraps and goes onto the next line.The first line 开发者_C百科of text is vertically aligned close to the center.But the broken second line

I have a box that is 300px wide and 30px high. I have text that wraps and goes onto the next line. The first line 开发者_C百科of text is vertically aligned close to the center. But the broken second line is still shown slightly in the box.

How do I either keep the line from being broken (on 1 line), or use line-height = 30px but have the text vertically aligned in the center?


This seems to work:

white-space: nowrap;

0

精彩评论

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