Posted By

andyr on 03/05/11


Tagged


Versions (?)

CSS Reset


 / Published in: CSS
 

  1. /*
  2.   HTML5 ✰ Boilerplate
  3.  
  4.   style.css contains a reset, font normalization and some base styles.
  5.  
  6.   credit is left where credit is due.
  7.   much inspiration was taken from these projects:
  8.   yui.yahooapis.com/2.8.1/build/base/base.css
  9.   camendesign.com/design/
  10.   praegnanz.de/weblog/htmlcssjs-kickstart
  11. */
  12.  
  13. /*
  14.   html5doctor.com Reset Stylesheet (Eric Meyer's Reset Reloaded + HTML5 baseline)
  15.   v1.4 2009-07-27 | Authors: Eric Meyer & Richard Clark
  16.   html5doctor.com/html-5-reset-stylesheet/
  17. */
  18.  
  19. html, body, div, span, object, iframe,
  20. h1, h2, h3, h4, h5, h6, p, blockquote, pre,
  21. abbr, address, cite, code,
  22. del, dfn, em, img, ins, kbd, q, samp,
  23. small, strong, sub, sup, var,
  24. b, i,
  25. dl, dt, dd, ol, ul, li,
  26. fieldset, form, label, legend,
  27. table, caption, tbody, tfoot, thead, tr, th, td,
  28. article, aside, canvas, details, figcaption, figure,
  29. footer, header, hgroup, menu, nav, section, summary,
  30. time, mark, audio, video {
  31. margin:0;
  32. padding:0;
  33. border:0;
  34. outline:0;
  35. font-size:100%;
  36. vertical-align:baseline;
  37. background:transparent;
  38. }
  39.  
  40. article, aside, details, figcaption, figure,
  41. footer, header, hgroup, menu, nav, section {
  42. display:block;
  43. }
  44.  
  45. nav ul { list-style:none; }
  46.  
  47. blockquote, q { quotes:none; }
  48.  
  49. blockquote:before, blockquote:after,
  50. q:before, q:after { content:''; content:none; }
  51.  
  52. a { margin:0; padding:0; font-size:100%; vertical-align:baseline; background:transparent; }
  53.  
  54. ins { background-color:#ff9; color:#000; text-decoration:none; }
  55.  
  56. mark { background-color:#ff9; color:#000; font-style:italic; font-weight:bold; }
  57.  
  58. del { text-decoration: line-through; }
  59.  
  60. abbr[title], dfn[title] { border-bottom:1px dotted; cursor:help; }
  61.  
  62. /* tables still need cellspacing="0" in the markup */
  63. table { border-collapse:collapse; border-spacing:0; }
  64.  
  65. hr { display:block; height:1px; border:0; border-top:1px solid #ccc; margin:1em 0; padding:0; }
  66.  
  67. input, select { vertical-align:middle; }
  68.  
  69. /* END RESET CSS */
  70.  
  71.  
  72. /* fonts.css from the YUI Library: developer.yahoo.com/yui/
  73.   Refer to developer.yahoo.com/yui/3/cssfonts/ for font sizing percentages
  74.  
  75.   There are three custom edits:
  76.   * remove arial, helvetica from explicit font stack
  77.   * we normalize monospace styles ourselves
  78.   * table font-size is reset in the HTML5 reset above so there is no need to repeat
  79. */
  80. body { font:13px/1.231 sans-serif; *font-size:small; } /* hack retained to preserve specificity */
  81.  
  82. select, input, textarea, button { font:99% sans-serif; }
  83.  
  84. /* normalize monospace sizing
  85.  * en.wikipedia.org/wiki/MediaWiki_talk:Common.css/Archive_11#Teletype_style_fix_for_Chrome
  86.  */
  87. pre, code, kbd, samp { font-family: monospace, sans-serif; }
  88.  
  89.  
  90. /*
  91.  * minimal base styles
  92.  */
  93.  
  94.  
  95. body, select, input, textarea {
  96. /* #444 looks better than black: twitter.com/H_FJ/statuses/11800719859 */
  97. color: #444;
  98. /* set your base font here, to apply evenly */
  99. /* font-family: Georgia, serif; */
  100. }
  101.  
  102. /* Headers (h1,h2,etc) have no default font-size or margin,
  103.   you'll want to define those yourself. */
  104. h1,h2,h3,h4,h5,h6 { font-weight: bold; }
  105.  
  106. /* always force a scrollbar in non-IE */
  107. html { overflow-y: scroll; }
  108.  
  109.  
  110. /* Accessible focus treatment: people.opera.com/patrickl/experiments/keyboard/test */
  111. a:hover, a:active { outline: none; }
  112.  
  113. a, a:active, a:visited { color: #607890; }
  114. a:hover { color: #036; }
  115.  
  116.  
  117. ul, ol { margin-left: 1.8em; }
  118. ol { list-style-type: decimal; }
  119.  
  120. /* Remove margins for navigation lists */
  121. nav ul, nav li { margin: 0; }
  122.  
  123. small { font-size: 85%; }
  124. strong, th { font-weight: bold; }
  125.  
  126. td, td img { vertical-align: top; }
  127.  
  128. sub { vertical-align: sub; font-size: smaller; }
  129. sup { vertical-align: super; font-size: smaller; }
  130.  
  131. pre {
  132. padding: 15px;
  133.  
  134. /* www.pathf.com/blogs/2008/05/formatting-quoted-code-in-blog-posts-css21-white-space-pre-wrap/ */
  135. white-space: pre; /* CSS2 */
  136. white-space: pre-wrap; /* CSS 2.1 */
  137. white-space: pre-line; /* CSS 3 (and 2.1 as well, actually) */
  138. word-wrap: break-word; /* IE */
  139. }
  140.  
  141. textarea { overflow: auto; } /* thnx ivannikolic! www.sitepoint.com/blogs/2010/08/20/ie-remove-textarea-scrollbars/ */
  142.  
  143. .ie6 legend, .ie7 legend { margin-left: -7px; } /* thnx ivannikolic! */
  144.  
  145. /* align checkboxes, radios, text inputs with their label
  146.   by: Thierry Koblentz tjkdesign.com/ez-css/css/base.css */
  147. input[type="radio"] { vertical-align: text-bottom; }
  148. input[type="checkbox"] { vertical-align: bottom; }
  149. .ie7 input[type="checkbox"] { vertical-align: baseline; }
  150. .ie6 input { vertical-align: text-bottom; }
  151.  
  152. /* hand cursor on clickable input elements */
  153. label, input[type=button], input[type=submit], button { cursor: pointer; }
  154.  
  155. /* webkit browsers add a 2px margin outside the chrome of form elements */
  156. button, input, select, textarea { margin: 0; }
  157.  
  158. /* colors for form validity */
  159. input:valid, textarea:valid { }
  160. input:invalid, textarea:invalid {
  161. border-radius: 1px;
  162. -moz-box-shadow: 0px 0px 5px red;
  163. -webkit-box-shadow: 0px 0px 5px red;
  164. box-shadow: 0px 0px 5px red;
  165. }
  166. .no-boxshadow input:invalid,
  167. .no-boxshadow textarea:invalid { background-color: #f0dddd; }
  168.  
  169.  
  170. /* These selection declarations have to be separate.
  171.   No text-shadow: twitter.com/miketaylr/status/12228805301
  172.   Also: hot pink. */
  173. ::-moz-selection{ background: #FF5E99; color:#fff; text-shadow: none; }
  174. ::selection { background:#FF5E99; color:#fff; text-shadow: none; }
  175.  
  176. /* j.mp/webkit-tap-highlight-color */
  177. a:link { -webkit-tap-highlight-color: #FF5E99; }
  178.  
  179. /* make buttons play nice in IE:
  180.   www.viget.com/inspire/styling-the-button-element-in-internet-explorer/ */
  181. button { width: auto; overflow: visible; }
  182.  
  183. /* bicubic resizing for non-native sized IMG:
  184.   code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/ */
  185. .ie7 img { -ms-interpolation-mode: bicubic; }
  186.  
  187.  
  188.  
  189. /*
  190.  * Non-semantic helper classes
  191.  */
  192.  
  193. /* for image replacement */
  194. .ir { display: block; text-indent: -999em; overflow: hidden; background-repeat: no-repeat; text-align: left; direction: ltr; }
  195.  
  196. /* Hide for both screenreaders and browsers
  197.   css-discuss.incutio.com/wiki/Screenreader_Visibility */
  198. .hidden { display: none; visibility: hidden; }
  199.  
  200. /* Hide only visually, but have it available for screenreaders
  201.   www.webaim.org/techniques/css/invisiblecontent/ & j.mp/visuallyhidden */
  202. .visuallyhidden { position: absolute !important;
  203. clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
  204. clip: rect(1px, 1px, 1px, 1px); }
  205.  
  206. /* Hide visually and from screenreaders, but maintain layout */
  207. .invisible { visibility: hidden; }
  208.  
  209. /* >> The Magnificent CLEARFIX: Updated to prevent margin-collapsing on child elements << j.mp/bestclearfix */
  210. .clearfix:before, .clearfix:after {
  211. content: "\0020"; display: block; height: 0; visibility: hidden;
  212. }
  213.  
  214. .clearfix:after { clear: both; }
  215. /* Fix clearfix: blueprintcss.lighthouseapp.com/projects/15318/tickets/5-extra-margin-padding-bottom-of-page */
  216. .clearfix { zoom: 1; }
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223. /* Primary Styles
  224.   Author:
  225.  */
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241. /*
  242.  * Media queries for responsive design
  243.  * These follow after primary styles so they will successfully override.
  244.  */
  245.  
  246. @media all and (orientation:portrait) {
  247. /* Style adjustments for portrait mode goes here */
  248.  
  249. }
  250.  
  251. @media all and (orientation:landscape) {
  252. /* Style adjustments for landscape mode goes here */
  253.  
  254. }
  255.  
  256. /* Grade-A Mobile Browsers (Opera Mobile, iPhone Safari, Android Chrome)
  257.   Consider this: www.cloudfour.com/css-media-query-for-mobile-is-fools-gold/ */
  258. @media screen and (max-device-width: 480px) {
  259.  
  260.  
  261. /* Uncomment if you don't want iOS and WinMobile to mobile-optimize the text for you
  262.   j.mp/textsizeadjust
  263.   html { -webkit-text-size-adjust:none; -ms-text-size-adjust:none; } */
  264. }
  265.  
  266. /*
  267.  * print styles
  268.  * inlined to avoid required HTTP connection www.phpied.com/delay-loading-your-print-css/
  269.  */
  270. @media print {
  271. * { background: transparent !important; color: #444 !important; text-shadow: none !important; }
  272. a, a:visited { color: #444 !important; text-decoration: underline; }
  273. a:after { content: " (" attr(href) ")"; }
  274. abbr:after { content: " (" attr(title) ")"; }
  275. .ir a:after { content: ""; } /* Don't show links for images */
  276. pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
  277. thead { display: table-header-group; } /* css-discuss.incutio.com/wiki/Printing_Tables */
  278. tr, img { page-break-inside: avoid; }
  279. @page { margin: 0.5cm; }
  280. p, h2, h3 { orphans: 3; widows: 3; }
  281. h2, h3{ page-break-after: avoid; }
  282. }
  283.  
  284.  

Report this snippet  

You need to login to post a comment.