使用jQuery检测字体大小(以像素为单位) [英] Detect font size in pixels using jQuery

查看:239
本文介绍了使用jQuery检测字体大小(以像素为单位)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用jQuery检测字体大小?如果我使用 em ,我需要检测字体大小(以像素为单位)

How can I detect font size using jQuery? If I am using em and i need to detect font size in pixels

<h1 style="font-size: 5em">Size of font in pixels?</h1>


推荐答案

http://jsfiddle.net/g9uKq/

我让你成为一个小提琴只是为了清楚。

I made you a fiddle just to be clear.

var size = $("h1").css('font-size');

这篇关于使用jQuery检测字体大小(以像素为单位)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆