网页前端后台技巧(CSS+HTML)

CSS Reset

2019-03-24  本文已影响3人  codeshaw
什么是CSS Reset?
为什么使用CSS Reset?
常见CSS Reset-1
<style>
*{
  padding: 0;
  margin: 0;
}
 </style>
常见CSS Reset-2

http://yui.yahooapis.com/3.18.1/build/cssreset/cssreset-min.css
代码如下:

html{color:#000;background:#FFF}
body,div,dl,dt,dd,ul,ol,li
,h1,h2,h3,h4,h5,h6,pre,code
,form,fieldset,legend,input
,textarea,p,blockquote,th,td{margin:0;padding:0}
table{border-collapse:collapse;border-spacing:0}
fieldset,img{border:0}
address,caption,cite,code
,dfn,em,strong,th,var{font-style:normal;font-weight:normal}
ol,ul{list-style:none}
caption,th{text-align:left}
h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal}
q:before,q:after{content:''}
abbr,acronym{border:0;font-variant:normal}
sup{vertical-align:text-top}
sub{vertical-align:text-bottom}
input,textarea,select{
font-family:inherit;font-size:inherit;
font-weight:inherit;
*font-size:100%
}
legend{color:#000}
body,div,dl,dt,dd,ul,ol,li
,h1,h2,h3,h4,h5,h6,pre,code
,form,fieldset,legend,input
,textarea,p,blockquote,th,td{margin:0;padding:0}
那些所谓需要重置的标签

https://www.zhangxinxu.com/wordpress/2010/04/css-reset%E7%9A%84%E9%87%8D%E6%96%B0%E5%AE%A1%E8%A7%86-%E9%81%BF%E5%85%8D%E6%A0%B7%E5%BC%8F%E9%87%8D%E7%BD%AE/

编写一套属于自己的CSS Reset
结语:只有适合自己的才是最好的

本人初次研究CSS Reset 有不足之处 还望各位大佬补充

上一篇 下一篇

猜你喜欢

热点阅读