用html+css可以很方便的进行网页的排版布局,但不是每一种属性或者代码都会记得。下面分享一些常用的代码块。
1、垂直居中对齐
.vc {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.vc {
position:absolute;
top: 50%;
left: 50%;
width: 100px;
height: 100px;
margin:-50px 0 -50px;
}