reset.scss 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. * {
  2. box-sizing: border-box;
  3. }
  4. /* 清除内外边距 */
  5. body,
  6. h1,
  7. h2,
  8. h3,
  9. h4,
  10. h5,
  11. h6,
  12. hr,
  13. p,
  14. blockquote,
  15. dl,
  16. dt,
  17. dd,
  18. ul,
  19. ol,
  20. li,
  21. pre,
  22. fieldset,
  23. button,
  24. input,
  25. textarea,
  26. th,
  27. td { /* table elements 表格元素 */
  28. padding: 0;
  29. margin: 0;
  30. }
  31. /* 设置默认字体 */
  32. body,
  33. button,
  34. input,
  35. select,
  36. textarea { /* for ie */
  37. font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', SimSun, sans-serif;
  38. font-size: 12px;
  39. outline: none;
  40. }
  41. h1 { font-size: 18px; /* 18px / 12px = 1.5 */ }
  42. h2 { font-size: 16px; }
  43. h3 { font-size: 14px; }
  44. h4,
  45. h5,
  46. h6 { font-size: 100%; }
  47. address,
  48. cite,
  49. dfn,
  50. em,
  51. var { font-style: normal; } /* 将斜体扶正 */
  52. code,
  53. kbd,
  54. pre,
  55. samp,
  56. tt { font-family: 'Courier New', Courier, monospace; } /* 统一等宽字体 */
  57. small { font-size: 12px; } /* 小于 12px 的中文很难阅读,让 small 正常化 */
  58. /* 重置列表元素 */
  59. ul,
  60. ol { list-style: none; }
  61. /* 重置文本格式元素 */
  62. a {
  63. text-decoration: none;
  64. -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
  65. }
  66. a:hover { text-decoration: none; }
  67. abbr[title],
  68. acronym[title] { /* 注:1.ie6 不支持 abbr; 2.这里用了属性选择符,ie6 下无效果 */
  69. border-bottom: 1px dotted;
  70. cursor: help;
  71. }
  72. q::before,
  73. q::after { content: ''; }
  74. /* 重置表单元素 */
  75. legend { color: #000; } /* for ie6 */
  76. fieldset,
  77. img { border: none; } /* img 搭车:让链接里的 img 无边框 */
  78. /* 注:optgroup 无法扶正 */
  79. button,
  80. input,
  81. select,
  82. textarea {
  83. font-size: 100%; /* 使得表单元素在 ie 下能继承字体大小 */
  84. }
  85. button {
  86. cursor: pointer;
  87. background: none;
  88. border: none;
  89. -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
  90. }
  91. /* 重置表格元素 */
  92. table {
  93. border-collapse: collapse;
  94. border-spacing: 0;
  95. }
  96. /* 重置 hr */
  97. hr {
  98. height: 1px;
  99. border: none;
  100. }
  101. /* 让非ie浏览器默认也显示垂直滚动条,防止因滚动条引起的闪烁 */
  102. html { overflow: hidden; }
  103. /* 其他常用样式 */
  104. .hidden {
  105. display: none !important;
  106. }
  107. .disabled {
  108. pointer-events: none;
  109. cursor: not-allowed;
  110. opacity: 0.65;
  111. filter: alpha(opacity=65);
  112. box-shadow: none;
  113. }
  114. ::-webkit-scrollbar {
  115. display: none;
  116. width: 0 !important;
  117. height: 0 !important;
  118. appearance: none;
  119. background: transparent;
  120. }