Posted By

doowron on 10/26/11


Tagged

design normalize responsive adaptive


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

spee66
mr2p


Normalize.css


 / Published in: CSS
 

URL: http://github.com/necolas/normalize.css

  1. /*! normalize.css 2011-06-21T18:23 UTC ยท http://github.com/necolas/normalize.css */
  2.  
  3. /* =============================================================================
  4.   HTML5 element display
  5.   ========================================================================== */
  6.  
  7. /*
  8.  * Corrects block display not defined in IE6/7/8/9 & FF3
  9.  */
  10.  
  11. article,
  12. aside,
  13. details,
  14. figcaption,
  15. figure,
  16. footer,
  17. header,
  18. hgroup,
  19. nav,
  20. section {
  21. display: block;
  22. }
  23.  
  24. /*
  25.  * Corrects inline-block display not defined in IE6/7/8/9 & FF3
  26.  * Known limitation: IE6 will not apply style for 'audio[controls]'
  27.  */
  28.  
  29. audio[controls],
  30. canvas,
  31. video {
  32. display: inline-block;
  33. *display: inline;
  34. zoom: 1;
  35. }
  36.  
  37.  
  38. /* =============================================================================
  39.   Base
  40.   ========================================================================== */
  41.  
  42. /*
  43.  * 1. Corrects text resizing oddly in IE6/7 when body font-size is set using em units
  44.  * http://clagnut.com/blog/348/#c790
  45.  * 2. Keeps page centred in all browsers regardless of content height
  46.  * 3. Removes Android and iOS tap highlight color to prevent entire container being highlighted
  47.  * www.yuiblog.com/blog/2010/10/01/quick-tip-customizing-the-mobile-safari-tap-highlight-color/
  48.  * 4. Prevents iOS text size adjust after orientation change, without disabling user zoom
  49.  * www.456bereastreet.com/archive/201012/controlling_text_size_in_safari_for_ios_without_disabling_user_zoom/
  50.  */
  51.  
  52. html {
  53. font-size: 100%; /* 1 */
  54. overflow-y: scroll; /* 2 */
  55. -webkit-tap-highlight-color: rgba(0,0,0,0); /* 3 */
  56. -webkit-text-size-adjust: 100%; /* 4 */
  57. -ms-text-size-adjust: 100%; /* 4 */
  58. }
  59.  
  60. /*
  61.  * Addresses margins handled incorrectly in IE6/7
  62.  */
  63.  
  64. body {
  65. margin: 0;
  66. }
  67.  
  68. /*
  69.  * Addresses font-family inconsistency between 'textarea' and other form elements.
  70.  */
  71.  
  72. body,
  73. button,
  74. input,
  75. select,
  76. textarea {
  77. font-family: sans-serif;
  78. }
  79.  
  80.  
  81. /* =============================================================================
  82.   Links
  83.   ========================================================================== */
  84.  
  85. a {
  86. color: #00e;
  87. }
  88.  
  89. a:visited {
  90. color: #551a8b;
  91. }
  92.  
  93. /*
  94.  * Addresses outline displayed oddly in Chrome
  95.  */
  96.  
  97. a:focus {
  98. outline: thin dotted;
  99. }
  100.  
  101. /*
  102.  * Improves readability when focused and also mouse hovered in all browsers
  103.  * people.opera.com/patrickl/experiments/keyboard/test
  104.  */
  105.  
  106. a:hover,
  107. a:active {
  108. outline: 0;
  109. }
  110.  
  111.  
  112. /* =============================================================================
  113.   Typography
  114.   ========================================================================== */
  115.  
  116. /*
  117.  * Addresses styling not present in IE7/8/9, S5, Chrome
  118.  */
  119.  
  120. abbr[title] {
  121. border-bottom: 1px dotted;
  122. }
  123.  
  124. /*
  125.  * Addresses style set to 'bolder' in FF3/4, S4/5, Chrome
  126. */
  127.  
  128. b,
  129. strong {
  130. font-weight: bold;
  131. }
  132.  
  133. blockquote {
  134. margin: 1em 40px;
  135. }
  136.  
  137. /*
  138.  * Addresses styling not present in S5, Chrome
  139.  */
  140.  
  141. dfn {
  142. font-style: italic;
  143. }
  144.  
  145. /*
  146.  * Addresses styling not present in IE6/7/8/9
  147.  */
  148.  
  149. mark {
  150. background: #ff0;
  151. color: #000;
  152. }
  153.  
  154. /*
  155.  * Corrects font family set oddly in IE6, S5, Chrome
  156.  * en.wikipedia.org/wiki/User:Davidgothberg/Test59
  157.  */
  158.  
  159. pre,
  160. code,
  161. kbd,
  162. samp {
  163. font-family: monospace, monospace;
  164. _font-family: 'courier new', monospace;
  165. font-size: 1em;
  166. }
  167.  
  168. /*
  169.  * Improves readability of pre-formatted text in all browsers
  170.  */
  171.  
  172. pre {
  173. white-space: pre;
  174. white-space: pre-wrap;
  175. word-wrap: break-word;
  176. }
  177.  
  178. /*
  179.  * 1. Addresses CSS quotes not supported in IE6/7
  180.  * 2. Addresses quote property not supported in S4
  181.  */
  182.  
  183. /* 1 */
  184.  
  185. q {
  186. quotes: none;
  187. }
  188.  
  189. /* 2 */
  190.  
  191. q:before,
  192. q:after {
  193. content: '';
  194. content: none;
  195. }
  196.  
  197. small {
  198. font-size: 75%;
  199. }
  200.  
  201. /*
  202.  * Prevents sub and sup affecting line-height in all browsers
  203.  * gist.github.com/413930
  204.  */
  205.  
  206. sub,
  207. sup {
  208. font-size: 75%;
  209. line-height: 0;
  210. position: relative;
  211. vertical-align: baseline;
  212. }
  213.  
  214. sup {
  215. top: -0.5em;
  216. }
  217.  
  218. sub {
  219. bottom: -0.25em;
  220. }
  221.  
  222.  
  223. /* =============================================================================
  224.   Lists
  225.   ========================================================================== */
  226.  
  227. ul,
  228. ol {
  229. margin: 1em 0;
  230. padding: 0 0 0 40px;
  231. }
  232.  
  233. dd {
  234. margin: 0 0 0 40px;
  235. }
  236.  
  237. nav ul,
  238. nav ol {
  239. list-style: none;
  240. }
  241.  
  242.  
  243. /* =============================================================================
  244.   Embedded content
  245.   ========================================================================== */
  246.  
  247. /*
  248.  * 1. Removes border when inside 'a' element in IE6/7/8/9
  249.  * 2. Improves image quality when scaled in IE7
  250.  * code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/
  251.  */
  252.  
  253. img {
  254. border: 0; /* 1 */
  255. -ms-interpolation-mode: bicubic; /* 2 */
  256. }
  257.  
  258. /*
  259.  * Corrects overflow displayed oddly in IE9
  260.  */
  261.  
  262. svg:not(:root) {
  263. overflow: hidden;
  264. }
  265.  
  266.  
  267. /* =============================================================================
  268.   Figures
  269.   ========================================================================== */
  270.  
  271. /*
  272.  * Addresses margin not present in IE6/7/8/9, S5, O11
  273.  */
  274.  
  275. figure {
  276. margin: 0;
  277. }
  278.  
  279.  
  280. /* =============================================================================
  281.   Forms
  282.   ========================================================================== */
  283.  
  284. /*
  285.  * Corrects margin displayed oddly in IE6/7
  286.  */
  287.  
  288. form {
  289. margin: 0;
  290. }
  291.  
  292. /*
  293.  * Define consistent margin and padding
  294.  */
  295.  
  296. fieldset {
  297. margin: 0 2px;
  298. padding: 0.35em 0.625em 0.75em;
  299. }
  300.  
  301. /*
  302.  * 1. Corrects color not being inherited in IE6/7/8/9
  303.  * 2. Corrects alignment displayed oddly in IE6/7
  304.  */
  305.  
  306. legend {
  307. border: 0; /* 1 */
  308. *margin-left: -7px; /* 2 */
  309. }
  310.  
  311. /*
  312.  * 1. Corrects font size not being inherited in all browsers
  313.  * 2. Addresses margins set differently in IE6/7, F3/4, S5, Chrome
  314.  * 3. Improves appearance and consistency in all browsers
  315.  */
  316.  
  317. button,
  318. input,
  319. select,
  320. textarea {
  321. font-size: 100%; /* 1 */
  322. margin: 0; /* 2 */
  323. vertical-align: baseline; /* 3 */
  324. *vertical-align: middle; /* 3 */
  325. }
  326.  
  327. /*
  328.  * 1. Addresses FF3/4 setting line-height using !important in the UA stylesheet
  329.  * 2. Corrects inner spacing displayed oddly in IE6/7
  330.  */
  331.  
  332. button,
  333. input {
  334. line-height: normal; /* 1 */
  335. *overflow: visible; /* 2 */
  336. }
  337.  
  338. /*
  339.  * 1. Improves usability and consistency of cursor style between image-type 'input' and others
  340.  * 2. Corrects inability to style clickable 'input' types in iOS
  341.  */
  342.  
  343. button,
  344. input[type="button"],
  345. input[type="reset"],
  346. input[type="submit"] {
  347. cursor: pointer; /* 1 */
  348. -webkit-appearance: button; /* 2 */
  349. }
  350.  
  351. /*
  352.  * Addresses box sizing set to content-box in IE8/9
  353.  */
  354.  
  355. input[type="checkbox"],
  356. input[type="radio"] {
  357. box-sizing: border-box;
  358. }
  359.  
  360. /*
  361.  * 1. Addresses appearance set to searchfield in S5, Chrome
  362.  * 2. Addresses box sizing set to border-box in S5, Chrome (include -moz to future-proof)
  363.  */
  364.  
  365. input[type="search"] {
  366. -webkit-appearance: textfield; /* 1 */
  367. -moz-box-sizing: content-box;
  368. -webkit-box-sizing: content-box; /* 2 */
  369. box-sizing: content-box;
  370. }
  371.  
  372. /*
  373.  * Corrects inner padding displayed oddly in S5, Chrome on OSX
  374.  */
  375.  
  376. input[type="search"]::-webkit-search-decoration {
  377. -webkit-appearance: none;
  378. }
  379.  
  380. /*
  381.  * Corrects inner padding and border displayed oddly in FF3/4
  382.  * www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/
  383.  */
  384.  
  385. button::-moz-focus-inner,
  386. input::-moz-focus-inner {
  387. border: 0;
  388. padding: 0;
  389. }
  390.  
  391. /*
  392.  * 1. Removes default vertical scrollbar in IE6/7/8/9
  393.  * 2. Improves readability and aligment in all browsers
  394.  */
  395.  
  396. textarea {
  397. overflow: auto; /* 1 */
  398. vertical-align: top; /* 2 */
  399. }
  400.  
  401.  
  402. /* =============================================================================
  403.   Tables
  404.   ========================================================================== */
  405.  
  406. /*
  407.  * Remove most spacing between table cells
  408.  */
  409.  
  410. table {
  411. border-collapse: collapse;
  412. border-spacing: 0;
  413. }

Report this snippet  

You need to login to post a comment.