How do I center a div inside another div? What about an image? I want it centered vertically and horizontally. I want to be modern and use flex - I don't care about old IE support.
.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>