QUOTE(nmduc073 @ Jun 27 2007, 01:32 PM)

When I design it, I hope that label, d2 and s1 is always within d1 whatever widths of those elements are. In fact, if d2's width is 300px, it overflows d1 what I don't want.
Is there any way to do it?
Yes, and it looks like you're pretty much on the right track

It's quite common to see what your d1 being called wrapper - but, a rose is a rose...
As long as you keep the nesting of your divs in order, it's fairly straightforward
Note: if d2.width > d1.width then d2 WILL 'overflow'

One solution:
set d2's width as a percentage (eg
width: 80%;) and, although only a child by virtue of being nested within d1, it will
inherit (from d1) a divisor value of 200px;
i.e.
d2 = 80% * 200px
= 160px 