It is stretching because align-self
default value is stretch
.
Set align-self
to center
.
align-self: center;
See documentation here:
align-self
More Related Contents:
- How do I use display:flex and justify-content:space-between, where the flex-item gets centered if there is only one of them?
- How to place elements like this
- Flexbox code working on all browsers except Safari. Why?
- How to center a flex container but left-align flex items
- Left column and stacked right column using flexbox CSS [duplicate]
- flex property not working in IE
- Last margin / padding collapsing in flexbox / grid layout
- Equal width flex items even after they wrap
- How to center elements on the last row in CSS Grid?
- Change div order with CSS depending on device-width
- input / button elements not shrinking in a flex container
- How can I combine flexbox and vertical scroll in a full-height app?
- Why isn’t object-fit working in flexbox?
- text-overflow is not working when using display:flex
- Removing margin from flex items when they wrap
- ‘position: sticky’ not working when ‘height’ is defined
- Calculator keypad layout with flexbox
- Flexbox alternative for IE9
- Prevent flex items from stretching
- Flexbox column-reverse in Firefox, Edge and IE
- Flex items not respecting margins and box-sizing: border-box
- Flex item should align left, not center, when it wraps
- Flexbox affects overflow-wrap behavior
- CSS only solution to set MULTIPLE “same height” row sections on a responsive grid
- Prevent a child element from overflowing its parent in flexbox [duplicate]
- Why isn’t position:sticky with left:0 working inside a scrollable container?
- Chrome does not expand flex parent according to children’s content [duplicate]
- Flexbox with fixed header and footer and scrollable content
- What are the default values for justify-content & align content?
- Sizing flex items on the last row