px

说明

相对长度单位。像素(Pixels)。

  • 1in = 2.54cm = 25.4 mm = 101.6q = 72pt = 6pc = 96px

兼容性

IE Firefox Chrome Safari Opera iOS Safari Android Browser Android Chrome
6.0+ 2.0+ 4.0+ 3.1+ 3.5+ 3.2+ 2.1+ 18.0+

示例


<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<style>
h1{margin:10px 0;font-size:16px;}
ul{margin:0;padding:0;list-style:none;}
li{margin-top:8px;background:#ccc;}
.in{width:1in;}
.pt{width:72pt;}
.pc{width:6pc;}
.px{width:96px;}
.cm{width:2.54cm;}
.mm{width:25.4mm;}
</style>
</head>
<body>
<h1>单位转换对比:</h1>
<ul>
    <li class="in">1in</li>
    <li class="pt">72pt</li>
    <li class="pc">6pc</li>
    <li class="px">96px</li>
    <li class="cm">2.54cm</li>
    <li class="mm">25.4mm</li>
</ul>
<p>1in = 2.54cm = 25.4 mm = 72pt = 6pc = 96px</p>
</body>
</html>