No replies
gidmeister
gidmeister's picture
Offline
Regular
NY
Last seen: 5 years 4 weeks ago
NY
Timezone: GMT-4
Joined: 2011-03-01
Posts: 47
Points: 93

I have a fixed width div. It has a max-width of 700 pixels.

I would like to insert radio button sets into it dynamically.

A radiobutton set would be something like
your height: o 6 feet o 5 feet o 4 feet

So if I had several sets, I could just add them inside the div, and if any set was going to overspill the right side of the outer div, I would want the whole set to move to the next line.

I would not want it to divide itself internally between (for example) 4 feet and 5 feet.

so I thought of putting each set in its own little div, with a min-width set in the little div. I would expect this to work, because the browser would realize the little div would not fit, and would move it to the next line.

But the problem is, I don't know the width that the little takes up. Since I'm adding it dynamically, I could first insert it into an invisible part of the page, and then get its width.

Is there any way around this?

Thanks