glz
06-21-2008, 03:01 AM
Hi, I asked before about trying to get approximate pixels for width & height of a single font character across browsers. I got a reply about how identifying such a thing is impossible... This is the background "big goal" of my current question, which is an idea on how to measure this pixel width & height of a text character.
Can you place things inside of a "stretchy" container(div) and then obtain the width & height of this stretchy container which will stretch to hold the contents (some text, some graphics.. whatever..).
If this is possible (and you understood my explanation ), can you show me some CSS/HTML code to do this?
The idea is the parent element container will be bigger than it was before because of the addition of a child element inside of it that causes it to expand. This expansion should be snug exactly to the child element as well. Therefore, by measuring the dimensions of the newly stretched parent element, you can know the dimensions of its child element.
-thanks http://bstats.freehostia.com/b.gif
Can you place things inside of a "stretchy" container(div) and then obtain the width & height of this stretchy container which will stretch to hold the contents (some text, some graphics.. whatever..).
If this is possible (and you understood my explanation ), can you show me some CSS/HTML code to do this?
The idea is the parent element container will be bigger than it was before because of the addition of a child element inside of it that causes it to expand. This expansion should be snug exactly to the child element as well. Therefore, by measuring the dimensions of the newly stretched parent element, you can know the dimensions of its child element.
-thanks http://bstats.freehostia.com/b.gif