![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm working on a site with a three-column-float, liquid-center layout .... But the form itself isn't floated, and this is causing me problems. The fieldset expands beyond the form and its containing div, and ends up overlapping the right column. You can see a minimal example at: http://www.jay.fm/files/overlapping.html |
|
I've tried floating the form and its div, but then the "bottom center" text ends up to the right of the form, for reasons I don't understand. I've also tried all sorts of position: relative, clear:both, and width: 100% band-aids to no good effect. What's the right thing to do here? |
#3
| |||
| |||
|
|
So cool: you've actually provided a URL and made a simplified example which (mostly) validates. I'm really motivated to help you. |
#4
| |||
| |||
|
|
Jay Levitt wrote: http://www.jay.fm/files/overlapping.html The *right* thing? Man, are you picky. I can promise only a hack. My solution/workaround/total hack first, arm-waving rationale after. Add a width, e.g. width:10em, to either the fieldset or form rules. I know you have a width:100% for fieldset already, but that's what's making it extend too far. I don't know what the fieldset thinks its width is 100% *of*. By providing a specific width, the problem seems to go away. In any case, it seems not to have to do with divs or floats. |
|
I actually reduced the problem even more. The code below also shows the same results: form><span>form stuff</span fieldset>in the fieldset</fieldset /form (<span> is just in there to make <form> more visible behind <fieldset>.) fieldset { background-color:green; width: 100%; } form { background-color:yellow; } |
|
Maybe somebody else here who knows about form stying can explain the problem from this. |
#5
| |||
| |||
|
|
I'm working on getting tableless forms working. You can see a minimal example at: http://www.jay.fm/files/overlapping.html |
#6
| |||
| |||
|
|
Ohhh, very interesting. So maybe 100% width in a fieldset means something other than the obvious... |
#7
| |||
| |||
|
|
In both examples, <fieldset> oversets the width of their container (viewport in the first instance and 450px in the second) because of fieldset>'s default padding and margin values as well as the border value. These default values cause the overset and the extension of fieldset> beyond the 100% width. |
![]() |
| Thread Tools | |
| Display Modes | |
| |