Get computed font size for DOM element in JS
Posted
by Pekka
on Stack Overflow
See other posts from Stack Overflow
or by Pekka
Published on 2009-12-23T20:13:10Z
Indexed on
2010/04/28
17:23 UTC
Read the original article
Hit count: 221
Is it possible to detect the computed font-size
of a DOM element, taking into consideration generic settings made elsewhere (In the body
tag for example), inherited values, and so on?
A framework-independent approach would be nice, as I'm working on a script that should work standalone, but that is not a requirement of course.
Background: I'm trying to tweak CKEditor's font selector plugin (source here) so that it always shows the font size of the current cursor position (as opposed to only when within a span
that has an explicit font-size
set, which is the current behaviour).
© Stack Overflow or respective owner