好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

CSS如何实现多行文本垂直居中效果_html/css_WEB-ITnose

CSS如何实现多行文本垂直居中效果:
想要实现单行文本在元素中垂直居中,非常的简单,只要将元素的line-height和height属性值设置为相同即可,例如:

line-height:30px;height:30px; 

但是要设置多行文本垂直居中效果,就稍稍费一些周折了,代码如下:

      蚂蚁部落  .vcenter {  width:100px;  height:102px;  vertical-align:middle;  display:table-cell;  overflow:hidden;  background:red;}   

蚂蚁部落欢迎您

查看更多关于CSS如何实现多行文本垂直居中效果_html/css_WEB-ITnose的详细内容...

  阅读:39次