Permalink
Browse files

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.
  • Loading branch information...
1 parent 31eb8b6 commit 23c6fe17d21c32899d60dd159b86611662dec7db @necolas necolas committed Jan 17, 2012
Showing with 7 additions and 4 deletions.
  1. +1 −1 demo.html
  2. +6 −3 normalize.css
View
@@ -247,7 +247,7 @@
<form>
<fieldset>
- <legend>Inputs as descendents of labels (form legend)</legend>
+ <legend>Inputs as descendents of labels (form legend). This doubles up as a long legend that can test word wrapping.</legend>
<p><label>Text input <input type="text" value="default value that goes on and on without stopping or punctuation"></label></p>
<p><label>Email input <input type="email"></label></p>
<p><label>Search input <input type="search"></label></p>
View
@@ -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 */
}
/*

0 comments on commit 23c6fe1

Please sign in to comment.