Resizing Issue and How to Fix It
Problem:
elements in certain browsers (notably Firefox) fail to scale down their width when the containing element's width is reduced. This leads to horizontal scrollbars and an improper fit within their parent container.
Root Cause:
By default, fieldsets have a minimum width of "min-content" applied to them. This can override any max-width or width rules you set through CSS.
Solution:
To allow
s to scale properly:
WebKit and Firefox 53 :
Set min-width: 0; on the fieldset to override the default value.
Firefox Prior to 53:
Set min-width: 0; on the fieldset.
Change the display property of the fieldset to one of the following: table-cell, table-column, table-column-group, table-footer-group, table-header-group, table-row, or table-row-group.
Recommended value: table-cell
Browser Compatibility:
The initial problem has been fixed in Firefox 53 and above.
The proposed solution with @-moz-document is now obsolete for this issue but should still work in older versions of Firefox.
Caution:
Avoid using @-moz-document to target Firefox in CSS outside of this specific issue. There are now better approaches to achieve browser-specific styling.
The above is the detailed content of How to Fix the Fieldset Resizing Issue in Firefox?. For more information, please follow other related articles on the PHP Chinese website!