Heim > Artikel > Web-Frontend > css多行文本垂直居中_html/css_WEB-ITnose
1. .outer { display:table; width:578px; overflow:hidden; background: #eee; height: 42px;}.middle {display:table-cell; vertical-align:middle; margin-left 10px;} /*下面的CSS是针对IE7,IE6*/<!--[if lte IE 7]><style>.outer{position:relative;}.middle{position: absolute; top: 50%;}.inner{position: relative; top:-50%}</style><![endif]-->2.(ie8+) .outer{ height: 271px; line-height: 271px; font-size: 0px;}#special-price .special-price-content .content li .mask p { font-size: 16px; line-height: 1.5; display: inline-block; vertical-align: middle;}