html移动端隐藏代码,html Css PC 移动端 公用部分样式代码整理

css常用公用部分样式代码整理:

body, html, div, blockquote, img, label, p, h1, h2, h3, h4, h5, h6, pre, ul, ol,

li, dl, dt, dd, form, a, fieldset, input, th, td

{margin: 0; padding: 0; border: 0; outline: none;}

ul, ol{list-style: none;}

a{color: black;text-decoration: none;}

a:hover {text-decoration: underline;}

html{font-size: 10px;font-family: "Microsoft YaHei",Arial;}

任意浏览器的默认字体高都是16px。所有未经调整的浏览器都符合: 1em=16px。

那么12px=0.75em,10px=0.625em。为了简化font-size的换算,

需要在css中的body选择器中声明Font-size=62.5%,

这就使em值变为 16px*62.5%=10px, 这样12px=1.2em, 10px=1em,

也就是说只需要将你的原来的px数值除以10,然后换上em作为单位就行了。

视口设置:

媒体查询

/*reset css*/ *,

::before,::after{

margin:0; padding:0;

/*清除移动端默认的点击高亮效果*/

-webkit-tap-highlight-color:transparent;

/*设置以边框开始计算宽度*/

-webkit-box-sizing:border-box;

box-sizing:border-box;

}

body{

font-size:14px;

font-family:"Microsoft YaHei",sans-serif;/*设备默认字体*/

color:#333;

}

a{

color:#333;

text-decoration:none;

}

a:hover {

text-decoration:none;

}

ul,ol {

list-style:none;

}

input {

border:none;

outline:none; /*清除移动端默认的表单样式*/

-webkit-appearance:none;

}

/*common css*/

.f_left{ float:left; }

.f_right{ float:right; }

.clearfix::before,.clearfix::after {

content:"";

height:0;

line-height:0;

display:block;

visibility:hidden;

clear:both;

}

来源:https://www.cnblogs.com/agansj/p/9339119.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值