img在div中上下左右居中
- html 代码如下:
<div id="aa">
<img src='xxxx.png'>
</div>
<div id="aa">
<img src='xxxx.png'>
</div>
- css:
#aa{
display: flex;
align-items: center;
justify-content: center;
}
#aa{
display: flex;
align-items: center;
justify-content: center;
}