2015年12月10日 星期四

Reset CSS – 重置歸零 – 網頁排版在各瀏覽器一致化

Reset CSS – 重置歸零 – 網頁排版在各瀏覽器一致化
只要在寫 CSS 前掛上這一段「Reset CSS」的語法,就可以解決各大瀏覽器初始化的差異


  1. <style>
  2. /* v1.0 | 20080212 */
  3.  
  4. html, body, div, span, applet, object, iframe,
  5. h1, h2, h3, h4, h5, h6, p, blockquote, pre,
  6. a, abbr, acronym, address, big, cite, code,
  7. del, dfn, em, font, img, ins, kbd, q, s, samp,
  8. small, strike, strong, sub, sup, tt, var,
  9. b, u, i, center,
  10. dl, dt, dd, ol, ul, li,
  11. fieldset, form, label, legend,
  12. table, caption, tbody, tfoot, thead, tr, th, td {
  13. margin: 0;
  14. padding: 0;
  15. border: 0;
  16. outline: 0;
  17. font-size: 100%;
  18. vertical-align: baseline;
  19. background: transparent;
  20. }
  21. body {
  22. line-height: 1;
  23. }
  24. ol, ul {
  25. list-style: none;
  26. }
  27. blockquote, q {
  28. quotes: none;
  29. }
  30. blockquote:before, blockquote:after,
  31. q:before, q:after {
  32. content: '';
  33. content: none;
  34. }
  35.  
  36. /* remember to define focus styles! */
  37. :focus {
  38. outline: 0;
  39. }
  40.  
  41. /* remember to highlight inserts somehow! */
  42. ins {
  43. text-decoration: none;
  44. }
  45. del {
  46. text-decoration: line-through;
  47. }
  48.  
  49. /* tables still need 'cellspacing="0"' in the markup */
  50. table {
  51. border-collapse: collapse;
  52. border-spacing: 0;
  53. }
  54. </style>


DownLoad: http://meyerweb.com/eric/tools/css/reset/reset.css

Source: http://meyerweb.com/eric/tools/css/reset/

Reference: http://www.flycan.com/article/css/reset-css-562.html

沒有留言:

張貼留言