css属性设置元素的垂直对齐方式_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 09:09:42
Original
1732 people have browsed it

vertical-align 属性设置元素的垂直对齐方式。

可能的值

描述
baseline 默认。元素放置在父元素的基线上。
sub 垂直对齐文本的下标。
super 垂直对齐文本的上标
top 把元素的顶端与行中最高元素的顶端对齐
text-top 把元素的顶端与父元素字体的顶端对齐
middle 把此元素放置在父元素的中部。
bottom 把元素的顶端与行中最低的元素的顶端对齐。
text-bottom 把元素的底端与父元素字体的底端对齐。
length
% 使用 "line-height" 属性的百分比值来排列此元素。允许使用负值。
inherit 规定应该从父元素继承 vertical-align 属性的值。

{
display: inline-block;
font-size: 12px;
line-height: 16px;
vertical-align: -webkit-baseline-middle;
}

{
padding: 1px 0px 1px 3px;
display: inline-block;
overflow: hidden;
line-height: 0em;
}

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
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!