CSS Flexbox
Today I found myself in the need to create a layout that I hadn’t done before:
This layout would be easy if I knew the widths of the elements, but I needed it to be flexible. Another possibility that crossed my mind was using percentages but there was a requirement that didn’t allow me to do it. To understand better there are a few things about the image above that I need to explain:
- The image has a static width
- I want the button on the right to expand and use as much space as it needs, but not more than it needs
- I want the center portion to use all the available space left by the image and the button