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

}

/*走盒子本身宽度的一半*/



之前想要把一个子盒子挪动到父盒子的



版权声明:新流派 - 专业行业资讯与产品服务平台 - x6p.cn ,转载请注明出处:https://www.x6p.cn/news/52d3899909.html

 
QQ在线咨询
售前咨询热线
020-123456789
微信号
020-123456789