css css3初始化样式

这个是我自己的用的有一套基础css css3样式(仅供参考)
新建reset.css

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,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video,
input {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font-weight: normal;
  vertical-align: baseline;
}

article,
aside,
details,
figcaption,
figure,
footer,
header,
menu,
nav,
section {
  display: block;
}


body {
  line-height: 1;
}

blockquote,
q {
  quotes: none;
}

blockquote:before,
blockquote:after,
q:before,
q:after {
  content: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

a {
  color: #7e8c8d;
  text-decoration: none;
  -webkit-backface-visibility: hidden;
}

li {
  list-style: none;
}


html,
body {
  width: 100%;
  height: 100%;
  overflow-y: hidden
}

body {
  -webkit-text-size-adjust: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  /*background-image: url(../images/bg.png);*/
  background-size: cover;
}

/* 设置滚动条的样式 */
::-webkit-scrollbar {
  width: 8px;
}

/* 滚动条滑块 */
::-webkit-scrollbar-thumb {
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.1);
}

.dis-flex {
  display: flex;
  display: -webkit-flex;
}

/*flex-wrap 属性用于指定弹性盒子的子元素换行方式。*/
.flex-wrap {
  flex-wrap: wrap;
  -webkit-flex-wrap: wrap;
}

.flex-nowrap {
  flex-wrap: nowrap;
  -webkit-flex-wrap: nowrap;
}

.flex-reverse {
  flex-wrap: wrap-reverse;
  -webkit-flex-wrap: wrap-reverse;
}

/*flex-direction 属性指定了弹性子元素在父容器中的位置。*/
.flex-row {
  flex-direction: row;
  -webkit-flex-direction: row;
}

.flex-reverse {
  flex-direction: row;
  -webkit-flex-direction: row-reverse;
}

.flex-column {
  flex-direction: column;
  -webkit-flex-direction: column;
}

.flex-column-reverse {
  flex-direction: column-reverse;
  -webkit-flex-direction: column-reverse;
}

/*内容对齐(justify-content)属性应用在弹性容器上,把弹性项沿着弹性容器的主轴线(main axis)对齐。*/
.justify-start {
  justify-content: flex-start;
  -webkit-justify-content: flex-start
}

.justify-end {
  justify-content: flex-end;
  -webkit-justify-content: flex-end;
}

.justify-center {
  justify-content: center;
  -webkit-justify-content: center;
}

.justify-between {
  justify-content: space-between;
  -webkit-justify-content: space-between;
}

.justify-around {
  justify-content: space-around;
  -webkit-justify-content: space-around;
}

/*align-items 设置或检索弹性盒子元素在侧轴(纵轴)方向上的对齐方式。*/
.items-start {
  align-items: flex-start;
  -webkit-align-items: flex-start
}

.items-end {
  align-items: flex-end;
  -webkit-align-items: flex-end;
}

.items-center {
  align-items: center;
  -webkit-align-items: center;
}

.items-baseline {
  align-items: baseline;
  -webkit-align-items: baseline;
}

.items-stretch {
  align-items: stretch;
  -webkit-align-items: stretch;
}

/*align-content 属性用于修改 flex-wrap 属性的行为。类似于 align-items, 但它不是设置弹性子元素的对齐,而是设置各个行的对齐。*/
.content-start {
  align-content: flex-start;
  -webkit-align-content: flex-start;
}

.content-end {
  align-content: flex-end;
  -webkit-align-content: flex-end;
}

.content-center {
  align-content: center;
  -webkit-align-content: center;
}

.content-between {
  align-content: space-between;
  -webkit-align-content: space-between;
}

.content-around {
  align-content: space-around;
  -webkit-align-content: space-around;
}

.content-stretch {
  align-content: stretch;
  -webkit-align-content: stretch;
}

/*排序 order*/
.order-1 {
  order: 1
}

.order-2 {
  order: 2
}

.order-3 {
  order: 3
}

.order-4 {
  order: 4
}

.order-5 {
  order: 5
}

.order-6 {
  order: 6
}

.order-7 {
  order: 7
}

.order-8 {
  order: 8
}

.order-10 {
  order: 10
}

.order-9 {
  order: 9
}

/*align-self 属性用于设置弹性元素自身在侧轴(纵轴)方向上的对齐方式。*/
.self-start {
  align-self: flex-start;
  -webkit-align-self: flex-start
}

.self-end {
  align-self: flex-end;
  -webkit-align-self: flex-end;
}

.self-center {
  align-self: center;
  -webkit-align-self: center;
}

.self-baseline {
  align-self: baseline;
  -webkit-align-self: baseline;
}

.self-stretch {
  align-self: stretch;
  -webkit-align-self: stretch;
}

/*flex 属性用于指定弹性子元素如何分配空间。*/
.flex-1 {
  flex: 1
}

.flex-2 {
  flex: 2
}

.flex-3 {
  flex: 3
}

.flex-4 {
  flex: 4
}

.flex-5 {
  flex: 5
}

.flex-6 {
  flex: 6
}

.flex-7 {
  flex: 7
}

.flex-8 {
  flex: 8
}

.flex-9 {
  flex: 9
}

.flex-10 {
  flex: 10
}

完成

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值