css重置

外部样式表

当样式需要被应用到很多页面的时候,外部样式表将是理想的选择。使用外部样式表,你就可以通过更改一个文件来改变整个站点的外观。

<head>
 <link rel="stylesheet" type="text/css" href="mystyle.css">
 </head> 

静止用户缩放

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> 

css重置PC端

html,body,ul,li,ol,dl,dd,dt,p,h1,h2,h3,h4,h5,h6,form,fieldset,legend,img,input,figure,figcaption{margin:0;padding:0;}
h1,h2,h3,h4,h5,h6{font-size:16px;font-weight:normal;}
ul,ol,li{list-style:none;}
b,strong{font-weight:normal;}
em,i{font-style:normal;}
a,u{text-decoration: none;}
img{border:0;display:block;}
input{outline:none;}

css重置用于移动端

html,body,ul,li,ol,dl,dd,dt,p,h1,h2,h3,h4,h5,h6,form,fieldset,legend,img,input,figure,figcaption{margin:0;padding:0;}
h1,h2,h3,h4,h5,h6{font-size:16px;font-weight:normal;}
ul,ol,li{list-style:none;}
b,strong{font-weight:normal;}
em,i{font-style:normal;}
a,u{text-decoration: none;}
img{border:0;display:block;}
input{outline:none;}
*{
    box-sizing:border-box;
}
html,body{
    height: 100%;
}

body{
    display: flex;
    flex-direction:column;
}

媒体查询

 @media all and (max-width:320px){
    html{font-size:12px;}
}
@media all and (min-width:321px) and (max-width:375px){
    html{font-size:14px;}
}
@media all and (min-width:376px){
    html{font-size:16px;}
}

vw结合rem写移动端

html,body,ul,li,ol,dl,dd,dt,p,h1,h2,h3,h4,h5,h6,form,fieldset,legend,img,input,figure,figcaption{margin:0;padding:0;}
h1,h2,h3,h4,h5,h6{font-size:16px;font-weight:normal;}
ul,ol,li{list-style:none;}
b,strong{font-weight:normal;}
em,i{font-style:normal;}
a,u{text-decoration: none;}
img{border:0;display:block;}
input{outline:none;}
*{
    box-sizing:border-box;
}
html,body{
    height: 100%;
}
html{
	font-size: 31.25vw;
}
body{
    display: flex;
    flex-direction:column;
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值