liveBook · Manning

Flex-end

As explained in Web Design Playground

A flexbox alignment value that places items at the end of the relevant axis or container edge.

Think of flex-end as telling a row of items, “Please gather at the far edge.” It places flex items at the end of their chosen axis. section 12.2

Use it in three small steps:

  • Make the element a flex container with display: flex. section 12.2
  • Choose the direction with flex-direction; this determines the main axis. section 12.2
  • Set justify-content: flex-end for the main axis, or align-items: flex-end for the cross axis. section 12.2

Captions at the bottom

A photo caption can use flex-direction: column and justify-content: flex-end so its text sits at the bottom of an overlay. Add a hover rule to reveal the caption. section 15.51

.image-caption {
    display: flex;    #1  
    flex-direction: column;    #1  
    justify-content: flex-end;    #1  
    position: absolute;    #2  
    left: 0;    #2  
    top: 0;    #2  
    width: 300px;    #3  
    height: 200px;    #3  
    background-color: rgba(32, 32, 32, 0.75);    #4  
    color: #ecd078;
    opacity: 0;    #5  
}

This complete caption rule shows flex-end working with a vertical main axis inside an absolutely positioned thumbnail overlay. section 15.51

How Web Design Playground covers it

How deep it goes
Defines the value, distinguishes both axes, and demonstrates it in a photo-caption layout.
Examples
Uses horizontal container arrangements, a numbered-list exercise, and bottom-aligned photo captions revealed on hover.
What it assumes
Assumes a flex container and basic axis terminology while introducing main-axis and cross-axis alignment.
What you can do after
Apply it via CSS to place flex items at a container edge or anchor overlay content at the bottom.
How it connects
Connects flex-end with Flexbox, flex containers, flex-direction, justify-content, align-items, and the cross axis.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Web Design Playground. The section links point to the parts of the book it draws on.