An Interest In:
Web News this Week
- April 29, 2024
- April 28, 2024
- April 27, 2024
- April 26, 2024
- April 25, 2024
- April 24, 2024
- April 23, 2024
July 1, 2019 02:15 pm GMT
Original Link: https://css-tricks.com/making-width-and-flexible-items-play-nice-together/
Making width and flexible items play nice together
The short answer: flex-shrink
and flex-basis
are probably what youre lookin for.
Lets say you want to align an image and some text next to each other with like this:
Now let's say you reach for flexbox to make it happen. Setting the parent element to display: flex;
is a good first start.
.container { display: flex; }
And this results in...
See the Pen
Flex-Shrink Example 1 by Robin Rendle (@robinrendle)
on CodePen.… Read article
Original Link: https://css-tricks.com/making-width-and-flexible-items-play-nice-together/
Share this article:
Tweet
View Full Article