html文本垂直居中对齐,代码如下:
行1
行2
行3
另一个span
实现原理:
1、首先设置div元素的高与行高为一样的值,这样在块内的行内元素就会垂直居中
2、设置span元素的显示,修改display为line-block,使其成为行内块元素
3、设置span的vertical-align为middle,以垂直居中,设置行高为1.2em,以改变继承的行高
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