移动端样式重置和常用css属性

样式重置代码

/********** reset.css *********/
body,
dl,
dt,
dd,
ul,
ol,
li,
h1,
h2,
h3,
h4,
h5,
h6,
pre,
code,
form,
fieldset,
legend,
input,
textarea,
p,
blockquote,
th,
td,
hr,
button,
article,
aside,
details,
figcaption,
figure,
footer,
header,
menu,
nav,
section {
  margin: 0;
  padding: 0;
  border: 0;
}
/* 按钮文本不可选 */
button {
  user-select: none;
}
img {
  vertical-align: middle;
}
/* 加载不出来的图片不要显示灰色边框 */
img:not([src]),
img[src=""] {
  opacity: 0;
}
ul,
ol {
  list-style: none;
}
table {
  border-collapse: collapse;
  border-spacing: 0;
}
input,
select,
button,
textarea {
  font-size: 100%;
  font: inherit;
}
html,
body {
  height: 100%;
  overflow-x: hidden;
}
a {
  text-decoration: none;
  outline: none;
}

a:active {
  outline: 0;
}

.clearfix {
  zoom: 1;
}

.clearfix:before,
.clearfix:after {
  content: "";
  display: table;
}

.clearfix:after {
  clear: both;
}

em {
  font-style: normal;
}

input {
  outline: none;
}

input[type="text"],
input[type="tel"] {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* 去除iphone ipad 设备默认按钮样式 */
input[type="button"],
input[type="submit"],
input[type="reset"] {
  -webkit-appearance: none;
  border-radius: 0;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0;
}

input::-moz-placeholder,
textarea::-moz-placeholder {
  color: #cccccc;
}

input:-ms-input-placeholder,
textarea:-ms-input-placeholder {
  color: #cccccc;
}

input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
  color: #cccccc;
}

个人常用样式

.modal-bg {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 100;
}

.show{
  display: block!important;
}

.hide{
  display: none!important;
}

@keyframes scale_an {
  from {
    transform: scale(1.05);
  }
  to {
    transform: scale(1.1);
  }
}

@keyframes translate_an {
  from{
    transform: translateX(-750px);
  }
  to{
    transform: translateX(0);
  }
}

@keyframes rotate_an {
  from{
    transform: rotate(0)
  }
  to{
    transform: rotate(360deg)
  }
}

参考地址:https://www.cnblogs.com/jiahuasir/p/11690216.html

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值