<!DOCTYPE html>
<html>
<head>
    <style>
        #main {
            width: 200px;
            height: 300px;
            background-color: gray;
            border: 1px solid black;
            display: flex;
            flex-wrap: wrap;
            justify-content: flex-end;
            align-items: flex-end;
        }

        #main div {
            flex-grow: 0;
            flex-shrink: 1;
        }
    </style>
</head>
<body>

<div id="main">
    <div style="background-color:green; flex-basis: 50px;"