Skip to content

Commit 23c6fe1

Browse files
committed
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.
1 parent 31eb8b6 commit 23c6fe1

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

demo.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ <h1>Forms</h1>
247247

248248
<form>
249249
<fieldset>
250-
<legend>Inputs as descendents of labels (form legend)</legend>
250+
<legend>Inputs as descendents of labels (form legend). This doubles up as a long legend that can test word wrapping.</legend>
251251
<p><label>Text input <input type="text" value="default value that goes on and on without stopping or punctuation"></label></p>
252252
<p><label>Email input <input type="email"></label></p>
253253
<p><label>Search input <input type="search"></label></p>

normalize.css

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! normalize.css 2012-01-17T14:17 UTC - http://github.com/necolas/normalize.css */
1+
/*! normalize.css 2012-01-17T15:37 UTC - http://github.com/necolas/normalize.css */
22

33
/* =============================================================================
44
HTML5 display definitions
@@ -315,12 +315,15 @@ fieldset {
315315

316316
/*
317317
* 1. Corrects color not being inherited in IE6/7/8/9
318-
* 2. Corrects alignment displayed oddly in IE6/7
318+
* 2. Corrects text not wrapping in FF3
319+
* 3. Corrects alignment displayed oddly in IE6/7
319320
*/
320321

321322
legend {
322323
border: 0; /* 1 */
323-
*margin-left: -7px; /* 2 */
324+
padding: 0;
325+
white-space: normal; /* 2 */
326+
*margin-left: -7px; /* 3 */
324327
}
325328

326329
/*

0 commit comments

Comments
 (0)