Fri, 2011-12-09 04:14
Is there a value that I can access and retrieve the current size of the text? For example, I have some text <div style={font-size=12pt;}>Many words of text</div>
I there a way I could insert an image inside the
and set its height to the size of the font (12 in this case)? I'm thinking there has got to be something like this: ![]()
Fri, 2011-12-09 04:18
#1
like this: <img
like this: <img style="height:div.font-size" ... />
Wed, 2011-12-14 19:03
#2
You could use jQuery for
You could use jQuery for that, here's an example.
http://jsfiddle.net/senff/AMAGf/
Note that it will take the number ONLY. So if the text is 20 PIXELS, the image height will be 20 pixels too. But if the text size is 20 POINTS, the image height will be 20 PIXELS.