开发者

Fieldset contents overflow in Firefox

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 wid开发者_如何学运维e 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>


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>


Try this:

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


As others have already mentioned, this is a bug in Firefox: Bug 261037 - overflow property not implemented on fieldset (reported in 2004, and still not fixed)


I had the same problem. FF does not allow overflow: hidden on fieldset tags regardless if you use overflow-y or overflow-x. My fix was using '-moz-hidden-unscrollable'. Like this...

fieldset{
    overflow: -moz-hidden-unscrollable;
}

It is a dirty hack but it works.

re: https://developer.mozilla.org/en-US/docs/Web/CSS/overflow#Values

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜