乐趣区

css-flex:在不确定div高的情况下让图片文字上下左右居中

html:<div class=”img”><img src=”/></div><div class=”text”><text>ddddd</text></div>css:.img{width:100%;height:100%;display:flex;align-items: center;justify-content: center;}.text{width:100%;height:100%;display:flex;align-items: center;justify-content: center;}

退出移动版