由于各⼤浏览器存在兼容性问题,同⼀个CSS属性在不同浏览器下的表现不⼀定相同,有经验的前端设计者都会⾃定义⼀个重置浏览器样式的CSS⽂件,在这个⽂件中定义⼀些针对不同的浏览器最终表现出⼀致的代码,⼤家最熟悉的也许就是* {margin:0 0}了,其实这是最简单的兼容性的代码,⼀般情况下,仅有这个是不够的,因此笔者收集了⼏个前端设计⽹站使⽤的reset.css代码模板,如果需要你可以复制这些代码保存为reset.css⽂件,然后引⽤在所需的html⽂件中即可。
注意:您可以根据您⾃⼰的实际情况去修改代码中选择器的定义,如果确定⽤不上代码中对某些选择器的定义,可以删除掉代码01:
body,ul,li,p,h1,h2,h3,h4,h5,h6,img,br,hr,table,tr,td,dl,dt,dd,form { margin: 0; padding: 0;}
body {
font-family: Arial,\"微软雅⿊\"; font-size: 12px; color: #434343;}
.clear {
clear: both; font-size: 0px;}ul,li {
list-style: none;}img {
border: none;}
/*⼀般链接*/a {
text-decoration: none; color: #555;}
a: hover {
color: #3366ff;}
代码01代码02:
@charset 'utf-8';
html,body,ul,li,ol,dl,dd,dt,p,h1,h2,h3,h4,h5,h6,form,fieldset,legend,img {margin:0;padding:0}
fieldset,img {border:0}img {
display:block}
address,caption,cite,code,dfn,th,var {font-style:normal;font-weight:normal}
ul,ol {
list-style:none}
input {
padding-top:0;padding-bottom:0;
font-family:\"SimSun\宋体\"}
input::-moz-focus-inner{border:0;padding:0}
select,input{
vertical-align:middle}
select,input,textarea{font-size:12px;margin:0}
input[type=\"text\"],input[type=\"password\"],textarea{outline-style:none;
-webkit-appearance:none}
textarea{resize:none}
table{
b order-collapse:collapse}
代码02
代码03:来⾃Eric Meyer⽹站
html, body, div, span, applet, object, iframe,h1, h2, h3, h4, h5, h6, p, blockquote, pre,a, abbr, acronym, address, big, cite, code,del, dfn, em, font, img, ins, kbd, q, s, samp,small, strike, strong, sub, sup, tt, var,dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td { margin: 0; padding: 0; border: 0; outline: 0;
font-weight: inherit; font-style: inherit; font-size: 100%; font-family: inherit; vertical-align: baseline;}
: focus { outline: 0;}
body {
line-height: 1; color: black;
background: white;}
ol, ul {
list-style: none;}
table {
border-collapse: separate; border-spacing: 0;}
caption, th, td { text-align: left;
font-weight: normal;}
blockquote: before, blockquote: after,q: before, q: after { content: \"\";}
blockquote, q { quotes: \"\" \"\";}
代码03
因篇幅问题不能全部显示,请点此查看更多更全内容
Copyright © 2019- huatuo6.com 版权所有 湘ICP备2023023988号-11
违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务