Home  >  Article  >  Web Front-end  >  css中字体垂直居中_html/css_WEB-ITnose

css中字体垂直居中_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:22:391346browse

在css中定义:

body{                                
margin: 0;                   
         padding: 0;                  
text-align: center;           
vertical-align:middle;
font: 16px Arial,宋体;        

}

但是字体不能垂直居中,为什么?


回复讨论(解决方案)

但是字体不能垂直居中,为什么?
re:
你不给一个高度,让它怎么垂直居中呀,像我让你算出n-n的合,你知道n-n代表什么吗

文字单行居中  line-height  

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn