Using CSS to Showcase the Art Gallery Page

This is my unique gallery display: https://i.stack.imgur.com/RddD8.png

Here is the look I am going for https://i.stack.imgur.com/kuOye.png

I want to showcase images in a slightly messy yet awesome way

However, I encounter an issue when some images have varying heights https://i.stack.imgur.com/CpoMs.png

There is whitespace left and it does not automatically fill that section. This whitespace needs to be filled.

This is my HTML & CSS Code :

.detail-img{
   width: 23%;
   margin: 10px;
   position: relative;
   min-height: 280px;
   max-height: 450px;
}
.galeri-row{
    margin: auto;
}

.galeri-row img{
    border-radius: 15px;
    object-fit: cover;
    object-position: center;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>


<section>
  <div class="container">
    <div class="row galeri-row justify-content-md-center">
      <a href="#" class="detail-img">
        <img src="img/src">
        <div class="detail-text">
          <span class="my-tag btn-success">TAG</span>
          <p>
          Lorem ipsum dolor sit amet consectetur...
          </p>
        </div>
      </a>
      <a href="#" class="detail-img galeri-sm">
        <img src="img/src">
        <div class="detail-text">
          <span class="my-tag btn-success">TAG</span>
          <p>
          Lorem ipsum dolor sit amet...
          </p>
        </div>
      </a>
      <a href="#" class="detail-img galeri-sm">
        <img src="img/src">
        <div class="detail-text">
          <span class="my-tag btn-success">TAG</span>
          <p>
          Lorem ipsum dolor sit amet...
          </p>
        </div>
      </a>
      <a href="#" class="detail-img">
        <img src="img/src">
        <div class="detail-text">
          <span class="my-tag btn-success">TAG</span>
          <p>
          Lorem ipsum dolor sit amet...
          </p>
        </div>
      </a>
           ...................
        </div>
   </div>
</section>

Answer №1

To maintain a fixed column layout, I recommend utilizing flexbox with a flex-direction set to "column". This will enable you to manage each column separately and efficiently.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The rendering of the input dropdown control in Angular JS is experiencing difficulties

I am currently using your Angular JS Input Dropdown control, and I have followed the code example provided on your demo page in order to implement the control on a specific page of my website built with PHP Laravel. However, I have encountered an issue dur ...

What is the best way to delete stored angularjs files permanently?

My web application, built on AngularJS, has certain functionalities that I have hidden from users. While the controls have been successfully hidden in the updated version of the file, there are still some users with the old file who can access these undesi ...

Avoid Scroll Below Stuck Navigation

I've been searching for a solution to my issue for some time now, and while I've come across many articles discussing similar problems, none of them seem to address my specific problem. In my React app, I have a mobile version where users can ta ...

Check to see if two words are identical in PHP

Could you please check the word I've written in the text field? If the two words are the same, I should receive a message saying "They are the same." <?php function array_random($arr, $num = 1) { shuffle($arr); $r = array(); for ($i = ...

The background color in CSS frames the text with a unique hue

Is there a way to wrap my multi-line text inside a div with a background color that automatically adjusts its size based on the text length? .multiline{ padding:0px; white-space: pre-wrap; height: 100px; width: ; margein:0px } <div style="b ...

What effect does setting div1 to float left have on the layout of div2 in css?

Behold the mystical code written in HTML. <div id="sidebar1"> sidebar1 </div> <div id="sidebar2"> sidebar2 </div> Beneath lies the enchanting CSS code for the aforementioned HTML structure. div { width: 100px; ...

Unable to adjust font weight as intended

I'm encountering an issue with getting the lighter font weights to display correctly. Despite having all the necessary font weights installed on my computer, it seems that many fonts do not support the lighter options. What could be causing this incon ...

Is it possible to send both props and a function within a single onClick event in React?

After spending hours searching for the right solution, I have yet to find it. Let me explain my situation clearly. I have an Image Carousel feature on my website that should open when a user clicks on an image. I have 5 images on the website, and when a us ...

Adjust the overall size of the CSS baseball field

Attempting to adjust the size of the baseball field proved challenging, as it wasn't a simple task. Is there a way to achieve this effectively? Thanks, HTML - is using DIV the only method for resizing? I couldn't find a way to resize everything a ...

The selenium element for the submit button is currently not responsive to interactions

Recently, I encountered some challenges with selenium, specifically the anticaptcha API. Although I managed to resolve that issue, I am currently facing a different problem. Below is my existing code: from time import sleep from selenium import webdriver f ...

The layout option is not specified within the ejs-mate package

error boilerplate I am baffled as to why the layout is not being defined. I have installed ejs-mate and ejs, yet it still gives this error. <% layout('layouts/boilerplate') %> <h1>All campgrounds </h1> <div> <a ...

What is the best way to navigate to the href link?

After attempting to use driver.find_element_by_id // link_text // partial link text without success, I'm wondering what method I should be using to access this href. Currently encountering a No Such Element Exception. Any assistance would be greatly a ...

Creating React components with scoped CSS imports

I am facing an issue with my component's CSS structure and import method. About/style.css .AboutContainer { # Some style } p > code { # Some style } When importing the CSS in the component: About/index.js import './style.css&apos ...

The dropdown button becomes unresponsive when attempting to navigate within it using ajax requests

Hello fellow members of the StackOverFlow community, I recently implemented a Bootstrap 5 dropdown button to fetch tabs from the backend using AJAX. Everything was functioning correctly until I encountered an issue where, upon clicking a button within one ...

Obtain the controller name from the current scope

I am trying to assign a controller named in the scope of another controller JavaScript file: .controller('PageCtrl', [ '$http', '$scope', '$routeParams', '$location', function($http, $scope, $ro ...

Adjust for the region shifted using transform: translate

I'm currently working on adjusting the positioning of elements using transform: translateY in CSS. The challenge I am facing is eliminating the empty space that appears between elements after repositioning one element below another without altering th ...

Support for nesting span elements in HTMLDocument

Struggling to incorporate this specific text into my HTMLDocument: <html><span class='stuff' id='X'><span id='Y'>content</span></span></html> Utilizing the following code for insertion: S ...

Attempting to repair navigation menu on grou.ps website

Hey there, I'm currently working on improving the appearance of my website. The original site can be found at . After integrating it with the grou.ps community platform, I noticed that the navigation menu is not displaying correctly and the image is ...

Strategies for identifying specific children in my particular situation

Here's a snippet of my code: <ul id='nav'> <li><h1 id='unique' class='title'>Topic</h1></li> <li><h1 class='toptitle'>Department</h1></ ...

Elevate your website design by adding interactive Ripple Buttons using a combination of Javascript and

Recently, I came across a script that allows for an animation to occur when a button is clicked. However, I have encountered an issue where the script does not redirect to a link. (function() { var cleanUp, debounce, i, len, ripple, rippleContainer, rip ...