本文共 624 字,大约阅读时间需要 2 分钟。
/* div上下左右居中的三种方法 */ /* 1 */ position: absolute; left: 50%; top:50%; transform: translate(-50%,-50%); border: orangered 1px solid; /* 2 */ width: 160px; height: 126px; position: absolute; left: 0; top: 0; bottom: 0; right: 0; margin:auto; border: orangered 1px solid; /*3*/ position: absolute; left: 50%; top: 50%; margin-left: -200px; margin-top: -200px;
转载地址:http://dvqen.baihongyu.com/