- 元素水平居中和垂直居中的方式
https://blog.csdn.net/zhuzj12345/article/details/53032892
- html,将元素水平,垂直居中的四种方式
https://www.cnblogs.com/SallyShan/p/11480685.html
布局参数
- layui-row :定义行
- layui-col-md* :定义一组col,放在row内
- md代表不同屏幕下的标记:xs - 手机;sm - 平板;md - 电脑
- *代表所占的12等分数,可选值为1-12
- 如果总和12就满行,否则另起一行
- 可以追加layui-col-space5、layui-col-md-offset3来表示列的间距和偏移
- border:粗细、边框、颜色
- border-radius:边框圆度
- box-shadow:边框阴影
固定尺寸的水平垂直居中方式
方式1:定位
.box{
width: 400px;
height: 300px;
border: 2px solid black;
/* 把元素变成定位元素 */
position: absolute;
/* 元素距离上,左都为50% */
left: 50%;
top: 50%;
/* 让元素的左外边距,上外边距为元素宽高的1/2 注意margin是负距*/
margin-top: -150px;
margin-left: -200px;
}