![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
usually i don't care... but if I use script.aculo.us, there is a Draggable class to use so that I can drag the div around... so the div turns out to enclose the max width across the screen. it can make the Draggable a bit weird if I just want a small area to be included -- one small element can overlap the other ones easily as the div is "max width" so I wonder, can I set the div to be "as small as possible", just to contain the elements inside but not more. I tried using width: auto and it wouldn't work. setting width to a small number like 30px seems to work alright, except it maybe better to let it just enclosed the elements inside but not more. |
#3
| |||
| |||
|
|
You need an element whose auto width is shrink-to-fit. That's anything with position: absolute or fixed, or that's floated, or display: table-cell or table. Not completely sure exactly what you're doing, but position: absolute with width: auto (the default) sounds like the most appropriate. |
![]() |
| Thread Tools | |
| Display Modes | |
| |