How can I make these images stay in a "grid"?

Matz Hilven

so I have some images with text underneath them, I want them to be the same size. And that worked, but I also want them to be in a sort of "raster", not a visible. But so they are on 1 line. I don't even know if the CSS is correct. It would also be cool if once someone donates, their image and name would appear directly on the site, this is probably hard. So that the images align is good enough for me.

CSS

.col-md_staffblock{
    margin: 30px auto;
    margin-bottom: 5px auto;
    padding: 10px 10px; 
}

HTML

<h1 >DONATORS</h1>
        <p>Donations help us keep our servers online 24/7.</p>
        <div class="row stafflist">

            <div class="col-md_staffblock">
                <img width="100px;" src="img/JOSH_KING222.png">
                <h2>JOSH_KING222</h2>
                <p>Donator</p>
            </div>

            <div class="col-md_staffblock">
                <img width="100px;" src="img/BuddySven.png">
                <h2>BuddySven</h2>
                <p>Donator</p>
            </div>

            <div class="col-md_staffblock">
                <img width="100px;" src="img/AllexX.png">
                <h2>AllexX</h2>
                <p>Donator</p>
            </div>

            <div class="col-md_staffblock">
                <img width="100px;" src="img/fond99.png">
                <h2>fond99</h2>
                <p>Donator</p>
            </div>

            <div class="col-md_staffblock">
                <img width="100px;" src="img/II_Sebs.png">
                <h2>II_Sebs</h2>
                <p>Donator</p>
            </div>

            <div class="col-md_staffblock">
                <img width="100px;" src="img/obesemessFTW69.png">
                <h2>obesemessFTW69</h2>
                <p>Donator</p>
            </div>

            <div class="col-md_staffblock">
                <img width="100px;" src="img/DcemilO.png">
                <h2>DcemilO</h2>
                <p>Donator</p>
            </div>

            <div class="col-md_staffblock">
                <img width="100px;" src="img/sonicboom62798.png">
                <h2>sonicboom62798</h2>
                <p>Donator</p>
            </div>
        </div>

And this html is the same for every image.

Hussein Al-Mosawi

As I understood your question my solution for it goes like that:-

HTML I changed your images so that I can have a preview you can use your default images if you want

<h1 >DONATORS</h1>
        <p>Donations help us keep our servers online 24/7.</p>
        <div class="row stafflist">

            <div class="col-md_staffblock">
                <img width="100px;" src="https://picsum.photos/seed/picsum/100">
                <h2>JOSH_KING222</h2>
                <p>Donator</p>
            </div>

            <div class="col-md_staffblock">
                <img width="100px;" src="https://picsum.photos/seed/picsum/100">
                <h2>BuddySven</h2>
                <p>Donator</p>
            </div>

            <div class="col-md_staffblock">
                <img width="100px;" src="https://picsum.photos/seed/picsum/100">
                <h2>AllexX</h2>
                <p>Donator</p>
            </div>

            <div class="col-md_staffblock">
                <img width="100px;" src="https://picsum.photos/seed/picsum/100">
                <h2>fond99</h2>
                <p>Donator</p>
            </div>

            <div class="col-md_staffblock">
                <img width="100px;" src="https://picsum.photos/seed/picsum/100">
                <h2>II_Sebs</h2>
                <p>Donator</p>
            </div>

            <div class="col-md_staffblock">
                <img width="100px;" src="https://picsum.photos/seed/picsum/100">
                <h2>obesemessFTW69</h2>
                <p>Donator</p>
            </div>

            <div class="col-md_staffblock">
                <img width="100px;" src="https://picsum.photos/seed/picsum/100">
                <h2>DcemilO</h2>
                <p>Donator</p>
            </div>

            <div class="col-md_staffblock">
                <img width="100px;" src="https://picsum.photos/seed/picsum/100">
                <h2>sonicboom62798</h2>
                <p>Donator</p>
            </div>
        </div>

Normal CSS

.stafflist {
  display: flex;
}

.col-md_staffblock  {
  margin: 10px
}

h2 {
  font-size: 12px
}

Using CSS3 grids Just change the number 8 to whatever number you want and you'll get a grid in X columns

.stafflist {
  display: grid;
  grid-template-columns: repeat(8, 1fr) ;

}

Hope this helps

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How can I generate and display a grid of images in PyTorch with plt.imshow and torchvision.utils.make_grid?

How to make images stay within the rows of a css grid container?

How can I make this responsive grid layout?

How can I make these two spans stay on the same line, no matter how narrow the browser window gets?

How can I make a sticky banner stay above the footer?

How can I use bootstrap grid mapping an array of images?

How to make images with anchor tags stay next to each other

How can I display these images in a 2x2 grid?

How do I make a button stay pressed?

On jquery fadeIn, how can i make it such that they will stay on the same line?

how can I add inner shadow to the images in my grid?

How do I make the grid lines in a JavaFX TableView stay sharp?

How can I make an image bar to stay on top with the menu on mobile?

How make responsive grid with images

How can I make windows stay opaque when inactive?

How can I make a window stay on Top using .Net?

How can i make this grid layout always stay the same size bootstrap 3?

How can I make the Windows 10 onscreen keyboard stay visible?

How can I make a favicon stay static?

How can I use images in a tkinter grid?

In Html using Grid layout how can I make last image align left when we have less than one row of images

How can I make infinite grid with canvas?

How can I make my dropdown menus stay visible on hover?

How can I make my webpage icon stay right?

why the x dose not stay and how should i make it stay on the board

How can I make an object float/stay in the air and not falling down?

How can I make this <div> stay in the <nav> while getting the results I want?

How can I make a grid of tiles (that can be rotated randomly) in processing?

How can I make a list of images clickable (modal images) in html?