<time-percentage>

CSS数据类型<time-percentage> 的值可以表示为时间或百分比。

Syntax

有关此类型允许的各个语法的详细信息,请参阅timepercentage的文档。

Use in calc()

如果将<time percentage>指定为允许的类型,这意味着该百分比解析为时间,因此可以在calc()表达式中使用。

Specifications

Specification Status Comment
CSS Values and Units Module Level 4
<time-percentage>
Editor's Draft  
CSS Values and Units Module Level 3
<time-percentage>
Candidate Recommendation Defines <time-percentage>. Adds calc()

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
<time-percentage>Chrome Full support 1Edge Full support 12Firefox Full support 4IE Full support 9Opera Full support 10.1Safari Full support 3.1WebView Android Full support 2Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 10.1Safari iOS Full support 2Samsung Internet Android Full support 1.0

Legend

Full support  
Full support