<style>
._1{
height:20%;
width:100%;
overflow:hidden;
white-space:nowrap;
text-overflow:ellipsis;
}
</style>
<div class="_1">content</div>
如何使内容在div中间对齐? 谢谢。 demo在div中间的CSS文本(div高度:20%)
编辑:身高是%不是px。我设置了line-height: 20%
但它不工作。
[CSS中心文本(水平和垂直)一个DIV块内(的可能的复制http://stackoverflow.com/questions/5703552/css-center-text-horizontal和垂直在一个div区块) –
@JishnuVS先生,身高是%不是px。 –