views:

228

answers:

2

Hi,

I am having a css issue with fieldset and wonder if you could help?

I have a fieldset with width smaller than its content div's width.

I want the fieldset to display a horizontal scroll bar as the content is too wide but it only works in IE's not Firefox.

Thanks in advance.

Eric

This is the html

<fieldset style=" width:150px; overflow:scroll;" >
    <div style="width:200px; height:50px; background:red;">
        Contents...
    </div>
</fieldset>
+1  A: 

The best thing I can come up with is to put 2 nested divs within the fieldset:

<fieldset style="width:150px" >
    <div style="width: 150px; overflow-x:scroll;">
        <div style="width:200px; height:50px; background:red;">
            Contents...
        </div>
    </div>
</fieldset>
mikez302
This works for me. Thanks Mike.
Eric
A: 

Try this:

<fieldset style=" width:150px;">
    <div style="width:200px; height:50px; background:red; overflow:scroll;">
        Contents...
    </div>
</fieldset>
Gabriel McAdams
overflow: scroll would force a scrollbar regardless, overflow: auto may be a better option.
Ben Rowe