rest css 清楚html得初始化格式

[复制链接]
查看: 182   回复: 0

138

主题

138

帖子

795

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
795
2023-4-16 14:01:17   显示全部楼层   阅读模式  
因为html默认有一堆格式 ,会影响我们项目开发得布局所以可以引用全局格式给整个来一个清场


2.jpg

  1. /**
  2. * Eric Meyer's Reset CSS v2.0 (http://meyerweb.com/eric/tools/css/reset/)
  3. * http://cssreset.com
  4. */

  5. html, body, div, span, applet, object, iframe,
  6. h1, h2, h3, h4, h5, h6, p, blockquote, pre,
  7. a, abbr, acronym, address, big, cite, code,
  8. del, dfn, em, img, ins, kbd, q, s, samp,
  9. small, strike, strong, sub, sup, tt, var,
  10. b, u, i, center,
  11. dl, dt, dd, ol, ul, li,
  12. fieldset, form, label, legend,
  13. table, caption, tbody, tfoot, thead, tr, th, td,
  14. article, aside, canvas, details, embed,
  15. figure, figcaption, footer, header, hgroup,
  16. menu, nav, output, ruby, section, summary,
  17. time, mark, audio, video{
  18.    margin: 0;
  19.    padding: 0;
  20.    border: 0;
  21.    font-size: 100%;
  22.    font: inherit;
  23.    font-weight: normal;
  24.    vertical-align: baseline;
  25. }
  26. /* HTML5 display-role reset for older browsers */
  27. article, aside, details, figcaption, figure,
  28. footer, header, hgroup, menu, nav, section{
  29.    display: block;
  30. }
  31. ol, ul, li{
  32.    list-style: none;
  33. }
  34. blockquote, q{
  35.    quotes: none;
  36. }
  37. blockquote:before, blockquote:after,
  38. q:before, q:after{
  39.    content: '';
  40.    content: none;
  41. }
  42. table{
  43.    border-collapse: collapse;
  44.    border-spacing: 0;
  45. }
  46.   
  47. /* custom */
  48. a{
  49.    color: #7e8c8d;
  50.    text-decoration: none;
  51.    backface-visibility: hidden;
  52.    -webkit-backface-visibility: hidden;
  53. }
  54. ::-webkit-scrollbar{
  55.    width: 5px;
  56.    height: 5px;
  57. }
  58. ::-webkit-scrollbar-track-piece{
  59.    background-color: rgba(0, 0, 0, 0.2);
  60.    border-radius: 6px;
  61.    -webkit-border-radius: 6px;
  62. }
  63. ::-webkit-scrollbar-thumb:vertical{
  64.    height: 5px;
  65.    background-color: rgba(125, 125, 125, 0.7);
  66.    border-radius: 6px;
  67.    -webkit-border-radius: 6px;
  68. }
  69. ::-webkit-scrollbar-thumb:horizontal{
  70.    width: 5px;
  71.    background-color: rgba(125, 125, 125, 0.7);
  72.    border-radius: 6px;
  73.    -webkit-border-radius: 6px;
  74. }
  75. html, body{
  76.    width: 100%;
  77.    height: 100%;
  78.    font-family: "Arial", "Microsoft YaHei", "黑体", "宋体", "微软雅黑", sans-serif;
  79. }
  80. body{
  81.    /* line-height: 1; */
  82.    -webkit-text-size-adjust: none;
  83.    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  84. }
  85. html{
  86.    overflow-y: scroll;
  87. }
  88.   
  89. /*清除浮动*/
  90. .clearfix:before,
  91. .clearfix:after{
  92.    content: " ";
  93.    display: inline-block;
  94.    height: 0;
  95.    clear: both;
  96.    visibility: hidden;
  97. }
  98. .clearfix{
  99.    *zoom: 1;
  100. }
  101.   
  102. /*隐藏*/
  103. .dn{
  104.    display: none;
  105. }



复制代码


回复

使用道具 举报

您需要登录后才可以回帖   登录 立即注册

高级模式

南通谢凡软件科技有限公司