注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

百鬼夜行

身是菩提树,心如明镜台,时时勤拂拭,勿使惹尘埃。

 
 
 

日志

 
 

line-height的兼容性(包括移动设备的浏览器支持)  

2014-06-17 16:26:04|  分类: 规范等 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
http://docs.webplatform.org/wiki/css/properties/line-height

line-height

W3C Recommendation

Summary

The line-height property specifies the height of an inline block level element. The value of the line-height property cannot be negative.

Overview table

Initial valuenormal
Applies toall elements
InheritedYes
Mediavisual
Computed valuefor <length> and <percentage> the absolute value; otherwise as specified
AnimatableYes
CSS Object Model PropertylineHeight

Syntax

  • line-height: <length>
  • line-height: <number>
  • line-height: <percentage>
  • line-height: none
  • line-height: normal

Values

normal
Take the height fixed by the default css of the user browser.

In most cases, it multiplies the height of the font by 1.2.

<number>
The used value of the property is this number multiplied by the element's font size. Negative values cannot be used.
<length>
The specified length is used in the calculation of the line box height: a number immediately followed by a length unit - pxempcinmm. Negative values cannot be used.
<percentage>
The value of this property is determined by multiplying this number by the element's font size. Negative values cannot be used.
none
This value has no effect on the rendering of the element and for block inline elements it is equivalent to 'normal.'

Examples

CSS

/* setting a line-height of 1.3em to a paragraph element with a font size of 1em*/

/* with a percentage */
p { line-height: 130% }

/* with a length */
p { line-height: 1.3em}

/* with a number */
p { line-height: 1.3}

Notes

Remarks

Line height is the distance between the descender of the font and the top of the internal leading of the font. If a formatted line contains more than one object, the maximum line height applies. In this case, negative values are not allowed.

Related specifications

SpecificationStatusRelated Changes
CSS1 line-heightW3C RecommendationInitial definition.
CSS2.1 line-heightW3C Recommendation
css3 transitionWorking DraftDefines line-height as animatable.

Compatibility

Desktop

FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic Support1.0
1.0 (1.7 or earlier)
4.0
7.0
1.0

Mobile

FeatureAndroidBlackBerryChrome for mobileFirefox Mobile (Gecko)IE MobileOpera MobileOpera MiniSafari Mobile
Basic Support1.0
4.6
1.0
1.0 (1)
6.0
6.0
Unsupported
1.0

See also

Related articles

Box Model

  • line-height

  评论这张
 
阅读(134)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018