normalize.css icon indicating copy to clipboard operation
normalize.css copied to clipboard

Fieldset min-width property

Open ahmadalfy opened this issue 7 years ago • 6 comments

Fieldset has an intrinsic min-width value set to min-content. Basically if it is not limited to the width of the its parents, it horizontally expand to fit anything inside it.

Adding this will prevent this behavior:

fieldset {
  min-width: 0;
}

I think it would be useful and will prevent that odd behavior. Any thoughts?

ahmadalfy avatar Jun 24 '17 00:06 ahmadalfy

Do different browsers handle that differently? If not, then that's what we would call an opinionated rule. The goal of this project is just to standardize between browsers – not so much to correct consistent bad defaults across all browsers.

garrettw avatar Jun 24 '17 04:06 garrettw

I will confirm, so far it is the same across edge, Chrome and Firefox

ahmadalfy avatar Jun 24 '17 04:06 ahmadalfy

This won't work in firefox.

4refael avatar Jun 24 '17 19:06 4refael

Damn is this a recent change? Just noticed this, googled, and landed here. Is there a global fix for all modern browsers yet?

bs-thomas avatar Jul 11 '17 17:07 bs-thomas

Maybe this post can help you: https://thatemil.com/blog/2015/01/03/reset-your-fieldset/

7studio avatar Jul 12 '17 11:07 7studio

@rellect According to that article, the Firefox fix is:

body:not(:-moz-handler-blocked) fieldset {
  display: table-cell;
}

I'm adding both fixes to my project Vitals right now.

garrettw avatar Jul 12 '17 18:07 garrettw