Home > Web Front-end > HTML Tutorial > CSS vertical-align 居中_html/css_WEB-ITnose

CSS vertical-align 居中_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 09:11:31
Original
1247 people have browsed it

一般常用的水平居中:

我们可以通过 text-align:center; 来设置

垂直居中:vertical-align:middli; //有时发现设置后没有任何样式的改变。因为 vertical-align 只对 依赖性的元素生效,即 display:inline-block; 有效。

另外还可以通过 : 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