重置浏览器默认样式

叁歲伎倆 2024-04-01 14:23 191阅读 0赞
  1. * {
  2. margin: 0;
  3. padding: 0;
  4. -webkit-user-drag: none;
  5. }
  6. html {
  7. line-height: 1.15;
  8. -webkit-text-size-adjust: 100%;
  9. }
  10. main {
  11. display: block;
  12. }
  13. a,
  14. ipnut,
  15. button,
  16. input,
  17. optgroup,
  18. select,
  19. textarea {
  20. cursor: pointer;
  21. }
  22. input,
  23. button {
  24. outline: none;
  25. }
  26. em,
  27. i {
  28. font-style: normal;
  29. }
  30. ol,
  31. ul {
  32. list-style: none;
  33. }
  34. h1 {
  35. font-size: 2em;
  36. margin: 0.67em 0;
  37. }
  38. hr {
  39. box-sizing: content-box;
  40. height: 0;
  41. overflow: visible;
  42. }
  43. img,
  44. svg {
  45. cursor: default;
  46. pointer-events: none;
  47. border: 0;
  48. vertical-align: middle;
  49. }
  50. pre {
  51. font-family: monospace, monospace;
  52. font-size: 1em;
  53. }
  54. a {
  55. background-color: transparent;
  56. text-decoration: none;
  57. }
  58. abbr[title] {
  59. border-bottom: none;
  60. text-decoration: underline;
  61. text-decoration: underline dotted;
  62. }
  63. b,
  64. strong {
  65. font-weight: bolder;
  66. }
  67. code,
  68. kbd,
  69. samp {
  70. font-family: monospace, monospace;
  71. font-size: 1em;
  72. }
  73. small {
  74. font-size: 80%;
  75. }
  76. sub,
  77. sup {
  78. font-size: 75%;
  79. line-height: 0;
  80. position: relative;
  81. vertical-align: baseline;
  82. }
  83. sub {
  84. bottom: -0.25em;
  85. }
  86. sup {
  87. top: -0.5em;
  88. }
  89. img {
  90. border-style: none;
  91. }
  92. button,
  93. input,
  94. optgroup,
  95. select,
  96. textarea {
  97. font-family: inherit;
  98. font-size: 100%;
  99. line-height: 1.15;
  100. margin: 0;
  101. }
  102. button,
  103. input {
  104. overflow: visible;
  105. }
  106. button,
  107. select {
  108. text-transform: none;
  109. }
  110. button,
  111. [type="button"],
  112. [type="reset"],
  113. [type="submit"] {
  114. -webkit-appearance: button;
  115. }
  116. button::-moz-focus-inner,
  117. [type="button"]::-moz-focus-inner,
  118. [type="reset"]::-moz-focus-inner,
  119. [type="submit"]::-moz-focus-inner {
  120. border-style: none;
  121. padding: 0;
  122. }
  123. button:-moz-focusring,
  124. [type="button"]:-moz-focusring,
  125. [type="reset"]:-moz-focusring,
  126. [type="submit"]:-moz-focusring {
  127. outline: 1px dotted ButtonText;
  128. }
  129. fieldset {
  130. padding: 0.35em 0.75em 0.625em;
  131. }
  132. legend {
  133. box-sizing: border-box;
  134. color: inherit;
  135. display: table;
  136. max-width: 100%;
  137. padding: 0;
  138. white-space: normal;
  139. }
  140. progress {
  141. vertical-align: baseline;
  142. }
  143. textarea {
  144. overflow: auto;
  145. }
  146. [type="checkbox"],
  147. [type="radio"] {
  148. box-sizing: border-box;
  149. padding: 0;
  150. }
  151. [type="number"]::-webkit-inner-spin-button,
  152. [type="number"]::-webkit-outer-spin-button {
  153. height: auto;
  154. }
  155. [type="search"] {
  156. -webkit-appearance: textfield;
  157. outline-offset: -2px;
  158. }
  159. [type="search"]::-webkit-search-decoration {
  160. -webkit-appearance: none;
  161. }
  162. ::-webkit-file-upload-button {
  163. -webkit-appearance: button;
  164. font: inherit;
  165. }
  166. details {
  167. display: block;
  168. }
  169. summary {
  170. display: list-item;
  171. }
  172. template {
  173. display: none;
  174. }
  175. [hidden] {
  176. display: none;
  177. }

发表评论

表情:
评论列表 (有 0 条评论,191人围观)

还没有评论,来说两句吧...

相关阅读

    相关 CSS Reset--默认样式

    CSS Reset,意为重置默认样式。HTML中绝大部分标签元素在网页显示中都有一个默认属性值,通常为了避免重复定义元素样式,需要进行重置默认样式(CSS Reset)。 实