reset.css文件,放置於網站根目錄css文件夾中
/* 把我們所有標簽的內外邊距清零 */ * { margin: 0; padding: 0; /* css3盒子模型 */ box-sizing: border-box; } /* html5新增 的布局元素 */ article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display:block;} /* em 和 i 斜體的文字不傾斜 */ em, i { font-style: normal } /* 去掉li 的小圓點 */ ul,ol,li { list-style: none } /* blockquote與q標簽都是用來表示內容引用,去掉引號 */ blockquote, q { quotes:none; } blockquote:before, blockquote:after, q:before, q:after { content:''; content:none; } textarea { overflow: auto; } small { font-size: 85%; } strong, th { font-weight: bold; } hr { border-bottom:1px solid #FFFFFF; border-top:1px solid #E4E4E4; border-width:1px 0; clear:both; height:2px; margin:5px 0; overflow:hidden; } /* border-collapse:collapse; 表示邊框合並在一起。 border-spacing 屬性設置相鄰單元格的邊框間的距離(僅用於“邊框分離”模式)。 */ table { border-collapse:collapse; border-spacing:0; } img { /* border 0 照顧低版本瀏覽器 如果 圖片外面包含了鏈接會有邊框的問題 */ border: 0; /* 取消圖片底側有空白縫隙的問題 */ vertical-align: middle } button { /* 當我們鼠標經過button 按鈕的時候,鼠標變成小手 */ cursor: pointer } a { color: #666; text-decoration: none; vertical-align:baseline; background:transparent; } a:hover { color: #c81623 } button, input { /* "\5B8B\4F53" 就是宋體的意思 這樣瀏覽器兼容性比較好 */ font-family: Microsoft YaHei, Heiti SC, tahoma, arial, Hiragino Sans GB, "\5B8B\4F53", sans-serif; /* 默認有灰色邊框我們需要手動去掉 */ border: 0; outline: none; } /*文字就會和INPUT框對齊。 */ input, select { vertical-align:middle; } body { /* CSS3 抗鋸齒形 讓文字顯示的更加清晰 */ -webkit-font-smoothing: antialiased; background-color: #fff; font: 12px/1.5 Microsoft YaHei, Heiti SC, tahoma, arial, Hiragino Sans GB, "\5B8B\4F53", sans-serif; color: #666 } .hide, .none { display: none } /* 清除浮動 */ .clearfix:after { visibility: hidden; clear: both; display: block; content: "."; height: 0 } .clearfix { *zoom: 1 }
參考文章:
https://blog.csdn.net/weixin_41986726/article/details/84140543
