Jump to content

Dynamic stretchy & snug containers? Possible?


dsaba

Recommended Posts

Hi, I asked 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

___________

Link to comment
Share on other sites

I'm not too sure exactly what you are trying to ask, but I can say this much - neither CSS nor HTML are programming languages. As such, they don't return values. They just take in code and display it, they aren't dynamic. So I think that whatever it is you are trying to ask, it can't be done.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.