Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

像素到 Ems 转换


像素到 EM 转换器

下面的工具可以帮助您从像素(反之亦然)计算出 em 大小。

  • 设置正文的默认像素大小(通常为 16px)
  • 然后,根据默认像素大小将像素值转换为 em。
  • 或者,根据默认像素大小将 em 值转换为像素。

设置默认像素大小

px

将 PX 转换为 EM
px

将 EM 转换为 PX
em


结果:


正文字体大小

在下表中,选择以像素 (px) 为单位的正文字体大小,以显示完整的“px 到 em 和百分比”转换表。

提示: 默认字体大小通常为 16px。

PX、EM 和百分比有什么区别?

像素是静态测量值,而百分比和 EM 是相对测量值。EM 或百分比的大小取决于其父级。如果正文的文本大小为 16 像素,则 150% 或 1.5 EM 将为 24 像素 (1.5 * 16)。请查看 CSS 单位 以获取更多测量单位。


×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
[email protected]

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
[email protected]

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2024 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.