Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fieldset firefox overflow CSS fix

Tags:

css

How can i set content to overflow in fieldset? It works in IE but not in FF.

Same functionality I can achieve with div element in both browsers.

Sample:

<fieldset style="border:thin solid #990033;">
    <legend>test</legend>
    <div style="background-color:#0033FF; height: 30px; width:800px;" >FIXED DIV</div>
</fieldset>
<p>&nbsp;</p>
<div style="border:1px solid #999999; padding:0 8px 8px 8px;">
    <label style="background-color:#FFFFFF; padding:0 5px; position:relative; top:-10px;" >test</label>
    <div style="background-color:#0033FF; height: 30px; width:800px;" >FIXED DIV</div>
</div>
like image 840
jmav Avatar asked Nov 04 '09 11:11

jmav


3 Answers

Found solution, add conditional css style:

fieldset {
    display: table-column;
}
<!–[if IE]>
fieldset {
    display: block;
}
<![endif]–>
like image 156
jmav Avatar answered Nov 02 '22 18:11

jmav


This is actually a bug in Firefox and it exists for almost 8 years. :D https://bugzilla.mozilla.org/show_bug.cgi?id=261037

like image 43
Jerome Avatar answered Nov 02 '22 19:11

Jerome


From a blog post by Emil Björklund:

body:not(:-moz-handler-blocked) fieldset {
  display: table-cell;
}
like image 34
Gebb Avatar answered Nov 02 '22 19:11

Gebb