How To Create a Responsive Image Grid (Masonry Layout) with HTML and CSS - Flexbox

preview_player
Показать описание
In this tutorial, you'll learn how to to create a responsive image grid with CSS.

Image list:

Sponsor me on GitHub!

Follow my blog:

Рекомендации по теме
Комментарии
Автор

dude you have no idea how much you saved me lol. i'm a high schooler who does a web dev internship who's been procrastinating all week, and i started my work almost an hour before my meeting. I was able to use this video to help me out and now i have 20 minutes to spare.

not_zara
Автор

I asked my self exactly the same, so few viewers ?
You deserve more.
For me this was what I needed.
But for total beginners they will manage to copy and make it work.
I think it could be s god thing to quickly explain how you build everything in boxes inside boxes (containers)
Then tell about the flex column and rows on the box above.
It took me quite some time before i realised that.
Just for future tutorials.
But anyway, this was perfect for me.
Quick and not dirty 🤪
And in a very calm way.
Thank you and keep going.

mohammadurgur
Автор

thank you so much! this is exactly what I was looking for

kayesong
Автор

thanks man! this was super useful for me!!

kristynaosickova
Автор

Great job! Need to do something similar at work this sprint.

DarthBallz
Автор

Thanks for this, fastest way to learn about flex box.

wisdomudo
Автор

You should get a lot mor attention and viewers, this was very god. Thank you. thumbs up, comment, and subscribed.

kalinkakylab
Автор

your voice is too sweet. thanks bro. grate work

LifeONEarth-hfdp
Автор

Tanks a lot, how can I link the images to anoter url page?

MontalvoRochaFelipe
Автор

Brilliant, thank you, this works perfectly. I've been looking for a tutorial on madonry grids that works for AGES!

Any suggestions on how I would go about having the column count go from 3 to 2 then to 1? I tried adding this in the CSS, but it didn't work:

/* XX-Large devices (desktops, 1400px and below) */
@media screen and (min-width: 1400px) {
.photo-gallery {
flex-direction: column;
column-count: 2;
}
}

/* Medium devices (tablets, 768px and below) */
@media screen and (max-width: 768px) {
.photo-gallery {
flex-direction: column;
}
}

veronica
Автор

Just wondering why this video has so little views specially likes and comments though its content is way much perfect...

Mr.K
Автор

How would you add this to a premade html/website with no css. Like the page has its own html.

cassandrafreeman
Автор

Nice video, but how does this work with an array of images. Will I need to write a code to split them into three columns or is there a better way.

shivaskanthan
Автор

i followe every step but it doesn t let me to put it on 3 colums when i set display flex for the photo-gallery div. why?:(

Nsbsha
Автор

hello, I tried to make this ( five column of nine photos) but it does not work... i am a bit stuck and if anyone as an idea of what cause this i would really appreciate some help !

nellepicard
Автор

I followed this to the letter 3 code does not display as did you leave out a piece so people would pay your for the missing code if so stop making tutorials for money

danisom