Width of characters
-
Hi all, Is there any way in which i can find out, using javascript, the width & height of a string when used with a particular font and size. eg.
<font size=4 face="verdana">Hello</font>
i wish to know what will be the width of "Hello" above as displayed on the web-page. Thanks in advance. *** Who said nothing is impossible? I have been doing it for a long time ***
-
Hi all, Is there any way in which i can find out, using javascript, the width & height of a string when used with a particular font and size. eg.
<font size=4 face="verdana">Hello</font>
i wish to know what will be the width of "Hello" above as displayed on the web-page. Thanks in advance. *** Who said nothing is impossible? I have been doing it for a long time ***
-
No. You have to put the text in an element, put the element on the page so that it's rendered, and then get the measurements of the element. --- b { font-weight: normal; }