Skip to content

Commit 4f1ba27

Browse files
committed
Improved display inline block
Improved <audio> display Added <input> <select> <textarea> box sizing
1 parent 15f071e commit 4f1ba27

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

normalize.css

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,22 @@ section {
1616
display: block;
1717
}
1818

19+
/*
20+
* Vertical align for display inline block elements
21+
* Improves visual appearance in all browsers
22+
*/
23+
1924
audio[controls],
25+
button,
2026
canvas,
27+
img,
28+
input,
29+
select,
30+
textarea,
2131
video {
2232
display: inline-block;
2333
*display: inline;
24-
_display: expression(this.controls ? 'inline' : 'none');
34+
vertical-align: top;
2535
*zoom: 1;
2636
}
2737

@@ -75,6 +85,19 @@ a:hover {
7585
outline: none;
7686
}
7787

88+
/*
89+
* Make display based on controls for <audio> element
90+
* Fixes styling not present in IE6/7/8
91+
*/
92+
93+
audio {
94+
display: none;
95+
}
96+
97+
audio[controls] {
98+
_display: expression(this.controls ? 'inline' : 'none');
99+
}
100+
78101
/*
79102
* 1.
80103
* Disable border for <img> element
@@ -250,4 +273,28 @@ input::-moz-focus-inner {
250273

251274
textarea {
252275
overflow: auto;
276+
}
277+
278+
/*
279+
* Define box sizing for <input> <select> <textarea> element
280+
* Addresses box sizing not supported in IE6/7
281+
*/
282+
283+
input[type='button'],
284+
input[type='checkbox'],
285+
input[type='radio'],
286+
input[type='submit'],
287+
select {
288+
box-sizing: border-box;
289+
-moz-box-sizing: border-box;
290+
-webkit-box-sizing: border-box;
291+
}
292+
293+
input[type='text'],
294+
input[type='password'],
295+
textarea {
296+
-webkit-appearance: textfield;
297+
box-sizing: content-box;
298+
-moz-box-sizing: content-box;
299+
-webkit-box-sizing: content-box;
253300
}

0 commit comments

Comments
 (0)