HTML5 CSS Reset


/ Published in: CSS
Save to your folder(s)

A collection of borrowed fixes.


Copy this code and paste it in your HTML
  1. /************************************************************************
  2. html5doctor.com Reset Stylesheet (Eric Meyer's Reset Reloaded + HTML5 baseline) v1.4 2009-07-27 | Authors: Eric Meyer & Richard Clark html5doctor.com/html-5-reset-stylesheet/
  3. ************************************************************************/
  4.  
  5. html, body, div, span, object, iframe,
  6. h1, h2, h3, h4, h5, h6, p, blockquote, pre,
  7. abbr, address, cite, code,
  8. del, dfn, em, img, ins, kbd, q, samp,
  9. small, strong, sub, sup, var,
  10. b, i,
  11. dl, dt, dd, ol, ul, li,
  12. fieldset, form, label, legend,
  13. table, caption, tbody, tfoot, thead, tr, th, td,
  14. article, aside, figure, footer, header, hgroup, menu, nav, section, menu,
  15. time, mark, audio, video {
  16. margin:0;
  17. padding:0;
  18. border:0;
  19. outline:0;
  20. font-size:100%;
  21. vertical-align:baseline;
  22. background:transparent;
  23. }
  24.  
  25. article, aside, figure, footer, header,
  26. hgroup, nav, section { display:block; }
  27.  
  28. nav ul { list-style:none; }
  29.  
  30. blockquote, q { quotes:none; }
  31.  
  32. blockquote:before, blockquote:after,
  33. q:before, q:after { content:''; content:none; }
  34.  
  35. a { margin:0; padding:0; font-size:100%; vertical-align:baseline; background:transparent; }
  36.  
  37. ins { background-color:#ff9; color:#000; text-decoration:none; }
  38.  
  39. mark { background-color:#ff9; color:#000; font-style:italic; font-weight:bold; }
  40.  
  41. del { text-decoration: line-through; }
  42.  
  43. abbr[title], dfn[title] { border-bottom:1px dotted #000; cursor:help; }
  44.  
  45. /* tables still need cellspacing="0" in the markup */
  46. table { border-collapse:collapse; border-spacing:0; }
  47.  
  48. hr { display:block; height:1px; border:0; border-top:1px solid #ccc; margin:1em 0; padding:0; }
  49.  
  50. input, select { vertical-align:middle; }
  51. /* END RESET CSS */
  52.  
  53.  
  54. /************************************************************************
  55. miscellaneous fixes
  56. ************************************************************************/
  57.  
  58. /* IE7 image resizing fix */
  59. .ie7 img { -ms-interpolation-mode: bicubic; }
  60.  
  61. /* font normalization across browsers */
  62. body { font:13px sans-serif; *font-size:small; *font:x-small; line-height:1.22; }
  63. table { font-size:inherit; font:100%; }
  64. select, input, textarea { font:99% sans-serif; }
  65.  
  66. /* Webkit font smoothing */
  67. html { -webkit-font-smoothing: antialiased; }
  68.  
  69. /* Formatting quoted text */
  70. pre {
  71. padding: 15px;
  72. white-space: pre; /* CSS2 */
  73. white-space: pre-wrap; /* CSS 2.1 */
  74. white-space: pre-line; /* CSS 3 (and 2.1 as well, actually) */
  75. word-wrap: break-word; /* IE */
  76. }
  77.  
  78. /* Clickable inputs */
  79. label, input[type=button], input[type=submit], button { cursor: pointer; }
  80.  
  81. /* align checkboxes, radios, text inputs with their label */
  82. input[type="radio"] { vertical-align: text-bottom; }
  83. input[type="checkbox"] { vertical-align: bottom; *vertical-align: baseline; }
  84. .ie6 input { vertical-align: text-bottom; }
  85.  
  86. /* Force scrollbar */
  87. html { overflow-y: scroll; }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.