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

WBOY
Release: 2016-06-24 12:22:39
Original
1345 people have browsed it

在css中定义:

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

}

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


回复讨论(解决方案)

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

文字单行居中  line-height  

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!