0
如何在另一個div中居中div?怎麼樣一個圖像?我希望它垂直和水平居中。我想要現代化並使用flex - 我不關心舊的IE支持。如何在div中水平和垂直對齊元素
.outside {
background: orange;
width: 400px;
height: 300px;
}
.inside {
width: 80%;
background: yellow;
}
<div class='outside'>
<div class='inside'>
This is the inside div that I would like to center in the outer one
</div>
</div>
---------------------------------------------------------------------------
<div class='outside'>
<img src="http://placehold.it/350x150">
</div>