HTML CSS examples for CSS Layout:Flex Center
Center Image inside of a flexbox
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .splash-container {<!--from w w w . j a v a2s . co m--> display: flex; height: 90vh; flex-direction: column; text-align: center; border: 10px solid goldenrod; justify-content: space-around; } .logo { flex-shrink: 1; background: red; } .logo img { max-width: 100%; max-height: 80%; } .mission { background: yellow; } </style> </head> <body> <div class="splash-container"> <div class="logo"> <img src="https://www.java2s.com/style/demo/Google-Chrome.png"> </div> <div class="mission"> <h1>Mission Statement</h1> <p>this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test </p> </div> </div> </body> </html>