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

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ธ.ค. 2024

ความคิดเห็น • 40

  • @not_zara
    @not_zara ปีที่แล้ว +20

    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.

  • @mohammadurgur953
    @mohammadurgur953 ปีที่แล้ว +4

    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.

  • @TanvirAhmed-ur3kr
    @TanvirAhmed-ur3kr 3 หลายเดือนก่อน +1

    Thank you for the video. But in practical, we usually don't want images to flow from top to bottom. Rather, images or grids should flow from left to right. So, even if we need JavaScript to do that, we should go with that. No client will tell me that I should use only CSS to do his website. However, while leaning CSS, these techniques will definitely help.

  • @snowandcoal
    @snowandcoal ปีที่แล้ว +3

    It starts at 4:30

  • @Mr.K123
    @Mr.K123 ปีที่แล้ว +2

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

  • @RCV_RCV
    @RCV_RCV หลายเดือนก่อน

    Most gallery videos, which do not use a library, have columns with images occupying the same width. I need a model similar to the home page of the wallpaperflare website, with images occupying the entire width of each line, but each image occupying proportionally in relation to the other images of the same line width. As I use placeholders, they all have the same height, only the width changes. I don't know how to resolve this.

  • @iSavil
    @iSavil ปีที่แล้ว +1

    Underrated video. Tysm

  • @wisdomudo8269
    @wisdomudo8269 7 หลายเดือนก่อน +1

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

  • @LifeONEarth-hf7dp
    @LifeONEarth-hf7dp 9 หลายเดือนก่อน

    your voice is too sweet. thanks bro. grate work

  • @cesarghful
    @cesarghful 5 หลายเดือนก่อน

    Nice and organized. Thanks buddy

  • @ЮлияРоманенко-к4ц
    @ЮлияРоманенко-к4ц 5 วันที่ผ่านมา

    Дякую🙏 , корисно 🤗👍

  • @nellepicard498
    @nellepicard498 6 หลายเดือนก่อน

    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 !

  • @TaraBetaDev
    @TaraBetaDev 23 วันที่ผ่านมา

    Hello, first tuto i watch on your channel. Great explanations, thank you, i was looking to make one gallery like this for a small project. But i think i made a mistake somewhere and not able to see with the video, i went on your github in order to check what i made and i am not able to see the good repo, what is its name please ? :-) thank you

  • @Nsbsha
    @Nsbsha 6 หลายเดือนก่อน

    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?:(

  • @kayesong5987
    @kayesong5987 ปีที่แล้ว

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

  • @kalinkakylab7276
    @kalinkakylab7276 ปีที่แล้ว

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

  • @rishabhrajpal9790
    @rishabhrajpal9790 9 หลายเดือนก่อน

    THAAANK YOOUU BROTHER

  • @kristynaosickova9905
    @kristynaosickova9905 ปีที่แล้ว

    thanks man! this was super useful for me!!

  • @queencass_talks
    @queencass_talks 4 หลายเดือนก่อน

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

    • @aleos3404
      @aleos3404 หลายเดือนก่อน

      Just add a new section to the html and then link a stylesheet in the head of the page, then go to the css and add the following items

  • @charlo-d2
    @charlo-d2 6 หลายเดือนก่อน

    What size are the images?

  • @MontalvoRochaFelipe
    @MontalvoRochaFelipe ปีที่แล้ว

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

  • @ina7717
    @ina7717 4 หลายเดือนก่อน

    thank you so much!

  • @shivaskanthan6144
    @shivaskanthan6144 ปีที่แล้ว +1

    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.

    • @codefoxx
      @codefoxx  ปีที่แล้ว

      Is the array of images coming from a server?

    • @shivaskanthan6144
      @shivaskanthan6144 ปีที่แล้ว

      Yeap. It come ms as an array of URL’s

  • @GROOVETECHSETS
    @GROOVETECHSETS 10 หลายเดือนก่อน +1

    Where is the code? Why no repo?

  • @veronica7322
    @veronica7322 ปีที่แล้ว

    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;
    }
    }

  • @evaavatar69
    @evaavatar69 ปีที่แล้ว

    thanks you so muchhhhhh, finally i did it T^T

  • @Andy-lr6mz
    @Andy-lr6mz ปีที่แล้ว

    thank you!

  • @benmyers4124
    @benmyers4124 3 หลายเดือนก่อน

    this but automate the creation of a perfect masonry layout with just the pictures XD :)

  • @seiftabaja2161
    @seiftabaja2161 4 หลายเดือนก่อน

    this will not work if all the images having the same size

  • @dimensionalilusions4520
    @dimensionalilusions4520 ปีที่แล้ว

    Not efficient method though

  • @danisom9520
    @danisom9520 ปีที่แล้ว +3

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

    • @codefoxx
      @codefoxx  ปีที่แล้ว +2

      Sorry to hear, do you have a GitHub? I can look at your code

    • @AM-cs8yi
      @AM-cs8yi ปีที่แล้ว +4

      Common Dan, the amount of free help this guy provides on his channel I seriously doubt he would do that

    • @AllNaturale11
      @AllNaturale11 ปีที่แล้ว

      lol same here. i thought I was doing something incorrectly. But i'll try again anyway

    • @HamzaAli-rn1cc
      @HamzaAli-rn1cc 5 หลายเดือนก่อน

      @@codefoxx Bro u only give flex and flex direction column in this video nothing about grid and your code respond like grid
      my main question is think u forget to add grid in ths video LOL