小白教程
所有教程
关于
Search
172.70.126.67
172.70.126.67
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Pr pos vertical align”的源代码
本页内容
上一节:
Pr_text_text_transform
下一节:
Pr_text_white_space
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:vertical-align}}[[Category:css reference|188]] = CSS vertical-align 属性 = 垂直对齐图像: <sample title="" desc="" lang="html" hererun="1"> img { vertical-align:text-top; } </sample> <run name=""> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>小白教程(xiaobai.wang)</title> <style> img.top {vertical-align:text-top;} img.bottom {vertical-align:text-bottom;} </style> </head> <body> <p>一个<img src="logo.png" alt="w3cschool" width="270" height="50" />默认对齐的图像。</p> <p>一个<img class="top" src="logo.png" alt="w3cschool" width="270" height="50" /> text-top 对齐的图像。</p> <p>一个<img class="bottom" src="logo.png" alt="w3cschool" width="270" height="50" /> text-bottom 对齐的图像。</p> </body> </html> </run> == 属性定义及使用说明 == vertical-align 属性设置一个元素的垂直对齐方式。 该属性定义行内元素的基线相对于该元素所在行的基线的垂直对齐。允许指定负长度值和百分比值。这会使元素降低而不是升高。在表单元格中,这个属性会设置单元格框中的单元格内容的对齐方式。 {| class="table table-striped table-hover" | 默认值: | baseline |- | 继承: | no |- | 版本: | CSS1 |- | JavaScript 语法: | object.style.verticalAlign="bottom" |} == 浏览器支持 == 表格中的数字表示支持该属性的第一个浏览器版本号。 {| class="table table-striped table-hover" ! 属性 ! Chrome ! Internet Explorer / Edge ! Firefox ! Safari ! Opera |- | vertical-align | 1.0 | 4.0 | 1.0 | 1.0 | 4.0 |} == 属性值 == {| class="table table-striped table-hover" ! 值 ! 描述 |- | baseline | 默认。元素放置在父元素的基线上。 |- | sub | 垂直对齐文本的下标。 |- | super | 垂直对齐文本的上标 |- | top | 把元素的顶端与行中最高元素的顶端对齐 |- | text-top | 把元素的顶端与父元素字体的顶端对齐 |- | middle | 把此元素放置在父元素的中部。 |- | bottom | 使元素及其后代元素的底部与整行的底部对齐。 |- | text-bottom | 把元素的底端与父元素字体的底端对齐。 |- | length | 将元素升高或降低指定的高度,可以是负数。 |- | % | 使用 "line-height" 属性的百分比值来排列此元素。允许使用负值。 |- | inherit | 规定应该从父元素继承 vertical-align 属性的值。 |} == 相关文章 == CSS 教程: [[css text|CSS 文本]]
返回至“
Pr pos vertical align
”。
上一节:
Pr_text_text_transform
下一节:
Pr_text_white_space