本站提倡有节制游戏,合理安排游戏时间,注意劳逸结合。

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

2026-11-22 21:42:15来源:热点分类:热点

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

}

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



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

相关推荐
一周热点