CSS3 Flexbox: Align-Items: Flex-End

With the align-items:flex-end; property, the flex items are positioned at the bottom of the container. The following example shows the result of using the flex-end value:

HTML file: Displayed by browser:
<style>
.flex-container {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: flex-end;
    align-items: flex-end;
    width: 400px;
    height: 250px;
    background-color: lightgrey;
}
.flex-item {
    background-color: cornflowerblue;
    width: 100px; /* NOTICE THERE IS NO HEIGHT*/
    margin: 10px;
}
</style>
<body>
<div class="flex-container">
    <div class="flex-item">flex item 1</div>
    <div class="flex-item">flex item 2</div>
    <div class="flex-item">flex item 3</div>
</div>
</body>
flex item 1
flex item 2
flex item 3

Without the height specified, the flex-items are aligned to the bottom of the flex-container and reduced to a size that accomodates the contents.

Back button Table of Contents Next button