CSS3: Flexbox and image alignment

This entry is part 8 of 13 in the series CSS3

We usually will have a block of text with an image besides the content.

<!DOCTYPE html>
<head lang='en'>
    <meta charset='UTF-8'>
        #flex-container {
            display: -webkit-flex;
            display: flex;
            width: 500px;
            height: 500px;
            background-color: gray;

        #flex-item {
            background-color: Silver;
            width: 200px;
            height: 200px;
            margin: 10px;
<div id='flex-container'>
    <div id='flex-item'>I am content block A</div>
    <div id='flex-item'><img src='https://codecrawl.com/code/images/ushuaia.jpg' alt='Ushuaia' width='200px' height='200px'/></div>

Series Navigation<< CSS3: Flexbox and block content
CSS3: Align the flex-items at center >>