左图右字各50%布局,右边字怎么水平垂直居中
2019-12-19 本文已影响0人
苹果咏
.parent{
position: relative;
.left_img{
width: 50%;
float: left;
}
.right_content{
position: absolute;
left: 50%;
top: 50%;
transform: translateY(-50%);
background-color: #fafafa;
width: 50%;
float: left;
height: 100%;
.mid_content{
position: absolute;
padding: 8rem;
top: 50%;
transform: translateY(-50%);
}
}
}