2 replies [Last post]
freebrownies
Offline
newbie
Last seen: 2 years 42 weeks ago
Timezone: GMT-5
Joined: 2011-12-09
Posts: 2
Points: 3

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:

freebrownies
Offline
newbie
Last seen: 2 years 42 weeks ago
Timezone: GMT-5
Joined: 2011-12-09
Posts: 2
Points: 3

like this: <img

like this: <img style="height:div.font-size" ... />

Senff
Senff's picture
Offline
Regular
Montreal, Canada
Last seen: 2 years 21 weeks ago
Montreal, Canada
Timezone: GMT-4
Joined: 2011-12-13
Posts: 16
Points: 19

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.

mS