浏览器样式初始化

less样式默认样式, 并让各大浏览器的样式统一

@charset "utf-8";

/* css reset:为什么? 为了重置默认样式, 并让各大浏览器的样式统一 */
/* 初始化 */
body,
div,
ul,
li,
ol,
h1,
h2,
h3,
h4,
h5,
h6,
input,
textarea,
select,
p,
dl,
dt,
dd,
a,
img,
button,
form,
table,
th,
tr,
td,
tbody,
article,
aside,
details,
figcaption,
figure,
footer,
header,
menu,
nav,
section {
  margin: 0;
  padding: 0;
  /* 给我们能用到的盒子都加上了, box-sizing: border-box; */
  box-sizing: border-box;
}

body {
  font: 12px/1 "Microsoft YaHei", "宋体", Tahoma, Arial, sans-serif;
  background-color: #fdfdfd;
}

/*去除边框*/
fieldset,
img,
input,
button,
textarea {
  border: none;
  /*去除的蓝色小边框*/
  outline-style: none;
}

/*禁止表单域缩放*/
textarea {
  resize: none;
}

a {
  text-decoration: none;
  color: #969696;
  /* 取消链接高亮(移动端)  */
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* 图片自适应 */
img {
  width: 100%;
  /*解决图片底部对其问题, 底部对齐问题, 只对于行内块元素有 */
  display: block;
}

ul,
ol {
  list-style: none;
}

/* 把所有的标题的样式全部重置了 */
h1,
h2,
h3,
h4,
h5,
h6 {
  text-decoration: none;
  font-weight: normal;
  font-size: 100%;
}

/* 废物利用 */
em,
i {
  font-style: normal;
}

/* 提供了一些公共类 */
.fl {
  float: left;
}

.fr {
  float: right;
}

/*清除浮动*/
.clearfix:before,
.clearfix:after {
  content: "";
  display: table;
}

.clearfix:after {
  clear: both;
}

/*单行溢出*/
.one-txt-cut {
  overflow: hidden;
  /* 文字在一行显示, 不换行 */
  white-space: nowrap;
  /* 文字溢出显示省略号 */
  text-overflow: ellipsis;
}

/*多行溢出*/
.txt-cut {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

css参考样式默认样式, 并让各大浏览器的样式统一

@charset "utf-8";
/* css reset:为什么? 为了重置默认样式, 并让各大浏览器的样式统一 */
/* 初始化 */
body,
div,
ul,
li,
ol,
h1,
h2,
h3,
h4,
h5,
h6,
input,
textarea,
select,
p,
dl,
dt,
dd,
a,
img,
button,
form,
table,
th,
tr,
td,
tbody,
article,
aside,
details,
figcaption,
figure,
footer,
header,
menu,
nav,
section {
  margin: 0;
  padding: 0;
  /* 给我们能用到的盒子都加上了, box-sizing: border-box; */
  box-sizing: border-box;
}
body {
  font: 12px/1 "Microsoft YaHei", "宋体", Tahoma, Arial, sans-serif;
  background-color: #fdfdfd;
}
/*去除边框*/
fieldset,
img,
input,
button,
textarea {
  border: none;
  /*去除的蓝色小边框*/
  outline-style: none;
}
/*禁止表单域缩放*/
textarea {
  resize: none;
}
a {
  text-decoration: none;
  color: #969696;
  /* 取消链接高亮(移动端)  */
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
/* 图片自适应 */
img {
  width: 100%;
  /*解决图片底部对其问题, 底部对齐问题, 只对于行内块元素有 */
  display: block;
}
ul,
ol {
  list-style: none;
}
/* 把所有的标题的样式全部重置了 */
h1,
h2,
h3,
h4,
h5,
h6 {
  text-decoration: none;
  font-weight: normal;
  font-size: 100%;
}
/* 废物利用 */
em,
i {
  font-style: normal;
}
/* 提供了一些公共类 */
.fl {
  float: left;
}
.fr {
  float: right;
}
/*清除浮动*/
.clearfix:before,
.clearfix:after {
  content: "";
  display: table;
}
.clearfix:after {
  clear: both;
}
/*单行溢出*/
.one-txt-cut {
  overflow: hidden;
  /* 文字在一行显示, 不换行 */
  white-space: nowrap;
  /* 文字溢出显示省略号 */
  text-overflow: ellipsis;
}
/*多行溢出*/
.txt-cut {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

All rivers run in to the sea

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值