好得很程序员自学网

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

CSS实现水平垂直同时居中的5种思路_html/css_WEB-ITnose

× 目录 [1]水平对齐+行高 [2]水平+垂直对齐 [3]margin+垂直对齐 [4]absolute [5]flex

前面的话

  水平居中和垂直居中已经单独介绍过,本文将介绍水平垂直同时居中的5种思路

思路一: text-align + line-height实现单行文本水平垂直居中

 .test{    text-align: center;    line-height: 100px;}  

测试文字

查看更多关于CSS实现水平垂直同时居中的5种思路_html/css_WEB-ITnose的详细内容...

  阅读:32次