Skip to content

Commit

Permalink
Add small improvements to legend normalization.
Browse files Browse the repository at this point in the history
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
necolas committed Jan 17, 2012
1 parent 31eb8b6 commit 23c6fe1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion demo.html
Expand Up @@ -247,7 +247,7 @@ <h1>Forms</h1>

<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>
Expand Down
9 changes: 6 additions & 3 deletions 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
Expand Down Expand Up @@ -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 */
}

/*
Expand Down

0 comments on commit 23c6fe1

Please sign in to comment.