paint-brush
How To Create Truly Responsive Images With Flexboxby@guirecordon
10,039 reads
10,039 reads

How To Create Truly Responsive Images With Flexbox

by Guilherme Recordon3mMay 11th, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

How To Create Truly Responsive Images With Flexbox is a fast way of building a web page with responsive images. Flexbox grids are often built using images. The solution I'm about to show how you could build a Flexbox grid without images. You calculate the aspect ratio of the image smallest in height by dividing the height by the width. Then you center the image—margin: auto is necessary for our example to work. Then, you add a wrapper around your image container to make it more responsive setting width in percents.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - How To Create Truly Responsive Images With Flexbox
Guilherme Recordon HackerNoon profile picture
Guilherme Recordon

Guilherme Recordon

@guirecordon

Full Stack Developer

Learn More
LEARN MORE ABOUT @GUIRECORDON'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Guilherme Recordon HackerNoon profile picture
Guilherme Recordon@guirecordon
Full Stack Developer

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite