What are some ways to expand the width and increase the spacing of bootstrap cards?

On my website, I have created Bootstrap cards that are displayed on two different pages. One set of cards is shown on the landing page, where I am looking to increase the spacing between them. The other set appears on the books page, and I want to make the cards wider. Below is the code snippet that I have applied to both pages. The only modification I made was changing '...col-lg-3' to '...col-lg-2' on line 6. I tried using 'd-flex justify-content-evenly' but it didn't work with col-lg-3.

<section id="about" class="ts-block">
               <div id="cards_landscape_wrap-2">
    <div class="container " style="width:70%">
        <div class="row d-flex justify-content-around">
        @foreach($products as $product)
            <div class="col-xs-12 col-sm-6 col-md-3 col-lg-3">
                <a href="{{route("products.show",$product->slug)}}">
                    <div class="card-flyer ">
                        <div class="text-box">
                            <div class="image-box">
                                <img src="{{asset($product->image)}}" alt="{{$product->title}}" class="img-fluid rounded mx-auto d-block" width="100%"/>
                            </div>
                            <div class="card-footer">
                                        <i class="text-muted"><strike>Ksh.{{$product->old_price}}</strike></i>
                                        <span class="text-primary font-weight-bold">Ksh.{{$product->price}}</span><br>
                                        <span class="mybuttonoverlap btn btn-primary">View</span>
                            </div>
                        </div>
                    </div>
                </a>
            </div>
            @endforeach
        </div>
    </div>
   </div>
        </section>        

Answer №1

Consider adding d-flex justify-content-around directly to the parent element that contains the cards, rather than using

<div class="row d-flex justify-content-around">
. Also, don't forget to add margin to the card elements.

<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 d-flex justify-content-around">
                <a href="{{route("products.show",$product->slug)}}">
                    <div class="card-flyer m-2">
                        <div class="text-box">
                            <div class="image-box">
                                <img src="{{asset($product->image)}}" alt="{{$product->title}}" class="img-fluid rounded mx-auto d-block" width="100%"/>
                            </div>
                            <div class="card-footer">
                                        <i class="text-muted"><strike>Ksh.{{$product->old_price}}</strike></i>
                                        <span class="text-primary font-weight-bold">Ksh.{{$product->price}}</span><br>
                                        <span class="mybuttonoverlap btn btn-primary">View</span>
                            </div>
                        </div>
                    </div>
                </a>
            </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

Implementing personalized SVG icons for list items

Here is some HTML code along with SCSS that I need help with: <div class="risk"> <ul> <li><span>Aggressive</span>Lorem ipsum dolor ...</li> <li><span>Growth</span>doloremque autem...</li ...

Personalized CSS styling for Jquery Mobile version 1.3

Having trouble with styling a page in jquery using CSS, specifically aligning #navgroup to the center of the footer and removing an additional white counter from the slider. Here is my code: <!doctype html> <html lang="en> <head> < ...

CSS - image does not adhere to max-height when placed in a fluid container - link to jsFiddle

For instance: http://jsfiddle.net/vjqjv/7/ I am facing an issue with an image inside a container (refer to #slider-section in the jsFiddle) that has a fluid height and a set max-height. I have defined max-height and max-width for my image as 100% (check ...

What is the best way to effectively nest Bootstrap grid without needing to enclose columns within another

I need to create a grid layout with 8 columns on the left and 4 columns on the right. Within the 4 columns on the right, I want to divide it into 4 smaller columns and 8 larger columns. It is crucial that the grid layout does not wrap onto multiple lines. ...

Guide on altering the cursor icon during an AJAX operation within a JQuery dialog

When I have a JQuery dialog open and make some $.ajax calls, why can't I change the cursor? I want to display a progress cursor while the code is processing so that users can see that the action is still ongoing. However, even though I update the CSS ...

media query for css on windows 7 mobile devices

Is there a way to apply CSS media queries specifically for Windows phone 7? I have attempted the following code without success: @media only screen and (max-width: 480px) and (min-width: 5px) { // css here } Any advice or guidance would be greatly appr ...

Learning how to effectively incorporate two matSuffix mat-icons into an input field

I'm currently experiencing an issue where I need to add a cancel icon in the same line as the input field. The cancel icon should only be visible after some input has been entered. image description here Here's the code I've been working on ...

Vertical centering issue with div specifically in Safari

I am facing an issue with centering a nested div containing a UL within another div. Despite trying various methods to achieve vertical alignment, I am unable to get it to work properly. PARENT .splash { background: url(../img/splash.jpg); backgro ...

Tips for creating a dynamic sticky footer

Seeking out a solution for a sticky footer that adjusts its height based on the width of the browser. Creating sticky footers in flexible designs can be tricky. I've come across various suggestions, discussions, and fixes for implementing sticky foot ...

Tips for maintaining the nested collapsible table row within the main table row in a React MUI table

I am working on implementing a Material UI (MUI) table that includes collapsible table rows. The challenge I am facing is maintaining consistent border and background colors across all the rows, even when some are collapsed. Currently, the separate rows ar ...

What is the best way to shift a text element within the footer section?

I have arranged two columns within the container, but I am looking to position the .company and .copyright text at the bottom left of the footer column. The Follow Us heading should be on the right side with the .justify-text below it, followed by social m ...

Creating responsive images using Bootstrap CSS framework

I have been focusing on optimizing the banner below the navigation menu on this website. My goal is to make it responsive so that the player in the banner remains visible even when scaling down to iPhone size portrait. You can find the code for this secti ...

Having difficulty distinguishing between public and private packages

Recently, I have been utilizing the Yarn package manager within my Laravel project to install public JavaScript libraries like jQuery and Bootstrap. To ensure all packages are readily available, I included a single line in my .yarnrc configuration file spe ...

Use radio buttons to enable switching between different data options within a dropdown menu

I am working on a dropdown box that is populated dynamically using JSON data. The content in the dropdown can be categorized into 4 types, so I have included radio buttons to switch between these categories. I have created HTML code to toggle between manu ...

The font remains the same despite the <Div style=> tag

I have a script that loads external HTML files, but I am facing an issue with changing the font to Arial. The script is as follows: <script type="text/javascript"> $(document).ready(function(){ $("#page1").click(function(){ ...

javascript issue with showing content on click

I'm currently working on a school assignment where I am using the onclick() function to display information about an object. However, I am facing an issue where the information is not popping up as expected. HTML <!DOCTYPE html> <html> ...

How can I manage the horizontal scrolling in a large, expansive HTML Bootstrap table?

Currently, I am working on a Laravel project and have encountered an issue with a table that is overflowing from the right side. Despite trying various methods for implementing horizontal scroll, none of them seem to be effective in resolving the problem. ...

Leveraging tailwind for achieving dynamic height responsiveness

My Tailwind-built page currently has a table in the bottom left corner that is overflowing, and I would like it to adjust its size to fit the available space and scroll from there. I want it to fit snugly in the bottom left corner of the browser viewport ...

Enhancing the appearance of multiple images with CSS and Bootstrap styling

I am struggling to arrange multiple images in my booking system as they are all displaying in a single column rather than the desired layout What I had hoped for was a layout like this Currently, I am using bootstrap to format the images. My goal is to i ...

Conceal certain columns within the pivot table

In my database, there are 2 tables named abc and xyz with a ManyToMany relationship established through another table called abc_xyz (with data returned under the pivot key). However, when retrieving the pivot key, it includes abc_id and xyz_id. I am curre ...