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

发布时间:2026-05-10 00:58:31 浏览次数:0

p {

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

}

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

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

css怎么让盒子旋转
需要做网站?需要网络推广?欢迎咨询客户经理 13272073477