From 23c6fe17d21c32899d60dd159b86611662dec7db Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Tue, 17 Jan 2012 15:42:10 +0000 Subject: [PATCH] Add small improvements to `legend` normalization. Remove the default padding. In theory, the correct normalization would be to add the padding to IE6/7 rather than remove it from all browsers. However, the most common use case is going to be for legends within unstyled fieldsets, and the presence of 2px of horizontal padding is likely to be unexpected. Allow text wrapping in Firefox 3. Modify the default white-space value to allow long legends to wrap. No simple fix to allow this in IE6/7/8. --- demo.html | 2 +- normalize.css | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/demo.html b/demo.html index 6fd5c61..da2854a 100644 --- a/demo.html +++ b/demo.html @@ -247,7 +247,7 @@
- Inputs as descendents of labels (form legend) + Inputs as descendents of labels (form legend). This doubles up as a long legend that can test word wrapping.

diff --git a/normalize.css b/normalize.css index df50916..97d35fb 100644 --- a/normalize.css +++ b/normalize.css @@ -1,4 +1,4 @@ -/*! normalize.css 2012-01-17T14:17 UTC - http://github.com/necolas/normalize.css */ +/*! normalize.css 2012-01-17T15:37 UTC - http://github.com/necolas/normalize.css */ /* ============================================================================= HTML5 display definitions @@ -315,12 +315,15 @@ fieldset { /* * 1. Corrects color not being inherited in IE6/7/8/9 - * 2. Corrects alignment displayed oddly in IE6/7 + * 2. Corrects text not wrapping in FF3 + * 3. Corrects alignment displayed oddly in IE6/7 */ legend { border: 0; /* 1 */ - *margin-left: -7px; /* 2 */ + padding: 0; + white-space: normal; /* 2 */ + *margin-left: -7px; /* 3 */ } /*