Get applied CSS rules?

J

Jeremy

Is there any way I can find the CSS rules that were applied to a
particular element? This is distinct from computedStyle - for example,
in Mozilla, I want to find the actual rules that were applied for
font-size, but computedStyle gives me the font-size after weighting it
with the user's text size preference.

Thanks,
Jeremy
 
B

Bart Van der Donck

Jeremy said:
Is there any way I can find the CSS rules that were applied to a
particular element? This is distinct from computedStyle - for example,
in Mozilla, I want to find the actual rules that were applied for
font-size, but computedStyle gives me the font-size after weighting it
with the user's text size preference.

<div style="font-size:20px"
onClick="alert(this.style.fontSize)">click</div>
<hr>
<div style="font-size:200%"
onClick="alert(this.style.fontSize)">click</div>
<hr>
<div style="font-size:3em"
onClick="alert(this.style.fontSize)">click</div>
<hr>
<div style="font-size:40pt"
onClick="alert(this.style.fontSize)">click</div>

Hope this helps,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top