1. 首页 >> 百科

css2D转化让盒子水平垂直居中

div {

    position: relative;

    width: 500px;

    height: 500px;

    background-color: pink;

}


p {

    position: absolute;

    top: 50%;

    left: 50%;

    width: 200px;

    height: 200px;

    background-color: rgb(216,转化 50, 50);

    transform: translate(-50%, -50%);

}

/*走盒子自己宽度的一半*/



以前想要把一个子盒子移动到父盒子的

本文采摘于网络,不代表本站立场,转载联系作者并注明出处:http://cppg.zkcsx.com/html/677d93598387.html

联系我们

在线咨询:点击这里给我发消息

微信号:020-123456789

工作日:9:30-18:30,节假日休息