Responsive design with Bootstrap 4's column grid system

Currently, we are striving to create a layout that resembles this design. However, I am facing difficulties in making it responsive. Can anyone offer some guidance?

Should we solely incorporate col-* classes? Additionally, we are restricted from setting specific heights because we are aiming for a puzzle-like appearance.

Visit this link for reference

<section class="books-wrapper">
<div class="container">
    <h2>Bestsellers</h2>
    <div class="books">
        <div class="bok">
            <img src="http://eredingnew.mobilshow.cz/img/book/1.png" alt="">
            <div class="info">
                <img src="img/icon/star.png" alt="">
            </div>
            <div class="title">
                <h3>Kruh</h3>
                <h4>Dave Eggers</h4>
            </div>
            <a class="price" href="#"><i class="fa fa-shopping-cart" aria-hidden="true"></i> 199 Kč</a>
        </div>

        <div class="bok">
            <img src="http://eredingnew.mobilshow.cz/img/book/8.png" alt="">
            <div class="title">
                <h3>Supergirl at Super Hero High</h3>
                <h4>Lisa Yee</h4>

            </div>
            <a class="price" href="#"><i class="fa fa-shopping-cart" aria-hidden="true"></i> 199 Kč</a>
        </div>

        <div class="bok">
            <img src="http://eredingnew.mobilshow.cz/img/book/2.png" alt="">
            <div class="info">
                Bestseller
            </div>
            <div class="title">
                <h3>A Hologram for the King</h3>
                <h4>Dave Eggers</h4>
            </div>
            <a class="price" class="price" href="#"><i class="fa fa-shopping-cart" aria-hidden="true"></i> 289
                Kč</a>
        </div>

        <!-- Additional book entries follow... -->

    </div>
</div>

// CSS Styles 
section.books-wrapper a.next {
  position: absolute;
  bottom: 0px;
  right: 70px;
  background-color: #c40058;
  color: #ffffff;
  text-transform: uppercase;
  width: 220px;
  height: 50px;
  line-height: 50px;
  text-align: center; }
// More CSS styles can be added here

Answer №1

apply css styling

@media only screen and (max-width: 1670px) {
      .books{
        -webkit-column-count: 6!important;
        -moz-column-count: 6!important;
        column-count: 6!important;
      }
    }
    @media only screen and (max-width: 1450px) {
      .books{
        -webkit-column-count: 5!important;
        -moz-column-count: 5!important;
        column-count: 5!important;
      }
    }
    @media only screen and (max-width: 1250px) {
      .books{
        -webkit-column-count: 4!important;
        -moz-column-count: 4!important;
        column-count: 4!important;
      }
    }
    @media only screen and (max-width: 1000px) {
      .books{
        -webkit-column-count: 3!important;
        -moz-column-count: 3!important;
        column-count: 3!important;
      }
    }
    @media only screen and (max-width: 765px) {
      .books{
        -webkit-column-count: 2!important;
        -moz-column-count: 2!important;
        column-count: 2!important;
      }
    }
    @media only screen and (max-width: 550px) {
      .books{
        -webkit-column-count: 1!important;
        -moz-column-count: 1!important;
        column-count: 1!important;
        margin: auto;
        width: 220px;
        margin-top: 40px;
      }
    }

Answer №2

To enhance the style of each "div" element in your code, add the subclass "blk" and also include the following CSS media query: The max-width value can be adjusted according to your specific requirements.

@media only screen and (max-width: 1024px){
  .blk {width: 100%};
}
<div class="bok blk">
  
</div>

}}

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

Title size in css

<div class="products_list products_slider"> <ul> <li> <a id="ContentPlaceHolder1_rptCategoryProducts_hlProductImg_0" class="product_image" href="/Urun/Oyuncak/woodoy-100-parca-kovali-ahsap-oyuncak-bloklar/7078"> <div class="produ ...

Exploring the Power of Selenium in Python: Automating the Clicking of Expand Links Without Identifiers

Struggling to fill out a form in IE9 using Selenium and Python. The form is loaded with 'Expand/Collapse' links, all identical except for the text labels. No ID on them, just 'style' and 'onclick' attributes (though there migh ...

Using JQuery and Ajax, what is the best way to transfer information from a popup form to a PHP page?

I've noticed that my question has been asked a few times already, but I'm still struggling to get my code working. It seems like I'm using the same code as those solutions, so I can't figure out what's going wrong. Currently, I am ...

Working with CSS styles for the <datalist> element

I currently have a basic datalist drop-down menu and I am looking to customize the CSS to match the style of other fields on my website. However, as someone new to web design, I am unsure of how to go about this process. Check out the code here: http://j ...

Embed JavaScript code in the head section of the webpage to guarantee its presence even following a page refresh

We recently obtained an innovative Enterprise Talent Management Solution that is cloud-based. One standout feature allows users to incorporate HTML Widgets with scripts on the primary Welcome Page. The customization options for the Welcome Page UI are qui ...

Sending a div class as a parameter to a JavaScript function

Wondering if it's possible to pass a div's class into a JavaScript function. I'm using SquareSpace so adding an id to the div is not an option, but it works fine with divs that have ids. JQuery is already loaded. This is my current train of ...

Iterating through elements to set the width of a container

I am currently working on a function that dynamically adjusts the width of an element using JavaScript. Here is my JavaScript code: <script> $('.progress-fill span').each(function(){ var percent = $(this).html(); if(per ...

The behavior of Mozilla in handling JQuery attr() function may result in variations in design elements such as font-family or font-size

I'm currently working on the login form. Below is my view in CodeIgnitor: <div id="login-form"> <?php echo heading('Login', 2); echo form_open('login/login_user'); echo form_input('email', set_value ...

Expand the image within the iron-image component

Within a div, I have an element: <div style="width:330px;"><iron-image src="image.png"></iron-image></div>. The image is 315px wide and 237px tall. I want the image to expand to 330px in width to fit its container without breaking t ...

What is the process for inserting an image into a table using el-table and el-table-column components in Vue.js while utilizing ui-elements?

I'm new to Vue.js and successfully built a basic table using the ui-element. The el-table element was utilized for constructing the table, with columns displayed using el-table-column and prop (see code below). Now, I want to incorporate images/avatar ...

What is the process for creating a clickable file upload in Angular?

Currently, I am utilizing the instructions found in this guide to implement a file upload feature in my project. The code provided works perfectly: <input type="file" class="file-input (change)="onFileSelected($event)" #fileUplo ...

Issue with implementing jQuery tab functionality

I'm just starting to learn JS, HTML, and CSS, and I could use some guidance on setting up jQuery tabs. Currently, I'm encountering an error that says "Uncaught TypeError: $(...).tabs is not a function". Any help would be greatly appreciated. Than ...

Resolving issues with CSS placement and resizing

I have been considering developing a UI toolkit that offers an intuitive and powerful way of setting the position and size of elements/widgets. Here are some examples of how it could be used (although they are not currently implemented): ui("Panel").size( ...

Troubleshooting problems with image display following jQuery animation

Check out this awesome page I found: where you can see a neat list of blog posts displayed in rows of 4. I've added a cool jQuery animation to the 'cards' so that they fade in one by one: jQuery('.fade-in-post-container .elementor-po ...

Tips on utilizing multiple dynamically generated toggle switches efficiently

As a Frontend beginner, I am working on implementing toggle switches using HTML, CSS, and Vanilla JavaScript. Approach: I am generating an HTML table with multiple rows based on the data from my Django database. Each row contains details like name, id, a ...

Can PHP retrieve data when the form submit function is overridden with AJAX?

I have customized the .submit function of a form on this webpage. It is being loaded inside the #mainContent in an "index.php" and I want the Submit button to only replace this #mainContent. My goal is to retrieve data from this form and send it to a .php ...

When applying a cell formatter to change the color of a Tabulator cell, the text displayed is being

I am attempting to dynamically change the color of a tabulator cell based on its input. My initial approach was to simply try changing the cell's color. After running the following code, here is what I observed: function testFormatter(cell, formatt ...

Extract JSON data from Python API

Currently, I am delving into web programming and have created a Python API that queries an SQL database to return a JSON. The functionality of the API is as expected. In parallel, I've developed a controller where I execute a GET request to utilize t ...

Using jQuery to dynamically disable links based on their HTML content

I am looking for a way to disable links based on the content within their HTML tags. In my website, there are several classified sections that may not always have content filled out. My goal is to visibly indicate to viewers when a classified section is em ...

Learn how to extract an entire table from a website using Kimono Labs, rather than just the first ten rows

Currently, I am utilizing Kimono labs to generate an API for scraping data from the table on this specific website. However, the website only displays the initial 10 rows of the table by default, limiting my API output to just 10 rows. Is there a method to ...