1:继承box-sizing
html {
box-sizing: border-box;
}
*,*:after,*:before {
box-sizing: inherit;
}
2:使用 :not() 选择器:last-child 选择器
2.1: last-child 的使用
ul {
width: 800px;
margin: 0 auto;
border: 1px solid red;
}
li {
width: 30px;
height: 30px;
margin: 5px;
border: 1px solid #dedede;
}
ul li:last-child {
border-right:none;
}
2.2:not()选择器的使用
ul li:not(:last-child) {
border-right: 1px solid red;
}
3:为body元素添加行高
body {
background: #f1f2f3;
font-family: "Open Sans", sans-serif;
line-height: 1.75;
}
4:元素垂直居中