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

To properly document the results, I must utilize a button to record the identification of a specific color

I'm working on a code that creates a clickable box which changes colors from black to green to white by going through different shades of green whenever the mouse is clicked. What I now need to do is implement a feature that displays the current shade ...

The function $(this).addClass() seems to be malfunctioning

While trying to follow a tutorial, I noticed that the style sheet isn't being applied to the clicked element in the list. What could be causing this issue? In the example provided, when a string is added to the text box and the button is clicked, a n ...

Using jQuery to smoothly scroll to a specific class name

I am faced with an HTML code snippet that looks like this: <div data-stored="storenow" data-save="save" class="saveIcon" data-unique="game">Save</div> My intention is to use jQuery to scroll to the game number 456 as shown below. var contain ...

What is preventing my CSS Animation from activating on my website?

Is there something in the code preventing the animation from working properly? .projectLinks a{ background-color: var(--secondary-color); color: var(--main-color); padding: 2px 4px 4px 4px; border-radius: 15px; margin-right: 25px; text-decorati ...

Route Laravel Packages

I have created some Laravel packages that work well when the user is not logged in. However, when a user logs in and visits a route from the packages, Laravel still considers the user as not being logged in. I have made sure that the user has successfully ...

When running the command "npm run dev" in Laravel, various errors may

I encountered several errors when running the npm command for my Laravel 5.6 project with Bootstrap. The output is as follows: $ npm run dev > @ dev /mnt/_work_sdb8/wwwroot/lar/B4test > npm run development > @ development /mnt/_work_sdb8/wwwro ...

On certain websites, the footer may appear distorted or incorrectly displayed when viewed in the IE 9 web browser

Currently experiencing an issue with the display of the footer in IE9. On some pages, the footer is not properly fixed and overlaps the middle of the content. However, this problem does not occur when using other web browsers. Here is the code that I am c ...

The CSS child selector seems to be malfunctioning as it is affecting all descendants of the specified type

Struggling with creating a menu containing nested lists. Attempted using a child selector (#menu-novo li:hover > ul) to display only immediate descendants, but all are still showing. Any suggestions or solutions for this issue? #menu-novo-container { ...

Implementing CSS loading in Vue 3's shadow DOM for nested components

I'm currently working on building an embeddable widget using a custom element with Vue. In order to achieve this, I've created a file called Widget.ce.vue and enabled style loading in the component's shadow root. However, I've run into ...

Achieving a tidy layout with child divs inside a parent div

I'm struggling to figure out how to arrange objects with margins inside a parent div. Initially, I thought using float would do the trick, but I quickly realized it wasn't the solution. This results in an unsightly amount of space. The divs that ...

Issue with Navbar Collapse Toggle not deactivating (following transition from bootstrap v4 beta to v4 alpha 6)

Recently, I encountered an issue with my navbar after switching to v4 alpha 6 in order to utilize the responsive utilities that this version offered. If you visit the following page: , you will see what I mean. Prior to upgrading to v4 alpha 6, all menu ...

Blank space appearing at the bottom of webpage

I have a strange issue with my document where there is a small white gap at the end. Upon inspecting the element, it seems to be related to the body. Any suggestions on how to resolve this? ...

'Dynamic' styling in Next.js using conditional CSS

I am exploring ways to style elements based on their parameters. I have been searching for terms like "conditional css react" and "implementing conditional styles in react with css". Here is a snippet of my code: e.g. <div class="ChatComponent_ ...

How can I prevent the content from sliding out of view in a Bootstrap carousel?

I am looking to create a slider that includes a form or text. However, I have noticed that when scaling up by 50-75% or when there is a lot of content, the content extends beyond the slider. Image Check out my code on jsfiddle: jsfiddle.net/sL70r2an/ ...

Exploring innovative CSS/Javascript techniques for creating intricate drawings

When using browsers other than Internet Explorer, the <canvas> element allows for advanced drawing. However, in IE, drawing with <div> elements can be slow for anything more than basic tasks. Is there a way to do basic drawing in IE 5+ using o ...

Using scope in ng-style to manipulate a portion of a CSS property value in Angular

I've been attempting to add a border using ng-style, but I'm struggling to figure out how to concatenate the value from the scope variable. None of the methods below seem to be working for me: <div ng-style="{'border-top' :'1p ...

An error occurred: [object Object] does not support the 'popup' method

I've been attempting to close the jQuery popup by using $('#partsPopup').popup("close"); However, I encountered an error stating that there is no method called "popup". Below is the sequence of scripts that I have followed. Any assistance wo ...

Don't forget to update the CSS stylesheet whenever templates are rendered in Flask

I have developed a Flask application using HTML and external (static) CSS stylesheets. One interesting feature of the application is a checkbox that uses JavaScript to toggle between two different CSS stylesheets - one for light mode and one for dark mode. ...

Developing automatic relationships between models in Laravel can streamline the process of querying related data

I'm new to the world of defining relationships and frameworks. I want to establish and create database relationships on models without having to make changes manually. For instance: Here is some pertinent information: User Table: Table: Users id ...

"Eliminating the visual feedback frame from your Samsung Galaxy browser: A step-by-step

After clicking a link, a dark orange frame is displayed around it. This frame can sometimes persist until the next scroll or screen touch. Similarly, when other elements are clicked, an orange frame may appear, adjusting in size to reflect the element cli ...