泽知隅网格社区

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%);

}

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



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

上一篇: FINELYCUP 梵妳卡波
下一篇: FRANGI 芙蓉肌
Copyright © 2024 Powered by css2D转化让盒子水平垂直居中 , 泽知隅网格社区sitemap 1.601s , 8165.5078125 kb