Is there a way to display two cards side by side in mobile view?

On a desktop view, 2 cards are displayed in a row. I would like them to also appear in a row on mobile view. I tried using col-sm-4 but it's not working. How can I get the cards to display in a row on mobile view so that I can see both the product photo and details without scrolling?

<div class="col-md-9 col-sm-12">

<div id="product_details_info">
  <div class="container-fluid">
    <h3 class="h2-title">Product Details</h3>
    <div class="row">

        <div class="col-md-6 col-sm-4 py-2">
            <div class="card h-100 card-body border-0 shadow">
              <img class="shadow d-block w-100" style="object-fit: none;height:450px;" src="{{asset('img/electrical.jpg')}}" alt="First slide">
            </div>
        </div>
        <div class="col-md-6 col-sm-4 py-3" id="order_now_section">
          <div class="card h-100 border-0 shadow">
              <div class="card-body" style="text-align:center;">
                <h3 class="product-title" style="font-family: 'Piedra', cursive;font-size:35px;text-align:center">men's shoes fashion</h3>

                <h5 class="quantity" style="font-family: 'Sriracha', cursive;">quantity</h5>

                <input type="number" class="form-control form-control-sm form-control-warning" style="width: 50%;margin:auto;text-align:center;" min="0">

                <h5 class="" style="font-family: 'Sriracha', cursive; padding-top:20px;">price</h5>
                <h5 class="" style="font-family: 'Sriracha', cursive;padding-bottom:10px; font-weight:bold;font-size:20px;">100 BDT</h5>
                <div class="action">
                  <a href="{{URL::to('/products/product_details')}}" type="button" class="btn btn-outline-info" style="font-weight:bold;"><i class="fas fa-cart-plus"></i>&nbsp Order Now </a>

                  <a href="{{URL::to('/products/product_details')}}" type="button" id="heart_id" class="btn btn-outline-info" style="font-weight:bold;"><span class="fa fa-heart"></span> </a>

                  <h3 class="product-title" style="font-family: 'Piedra', cursive;font-size:20px;padding-top:20px;text-align:center">Product Details</h3>
                  <p class="product-description" style="font-family: 'Raleway', sans-serif;">Suspendisse quos? Tempus cras iure temporibus? Eu laudantium cubilia sem sem! Repudiandae et! </p>
                </div>
              </div>
          </div>
      </div>
    </div>
  </div>
  </div>
 </div>  

Answer №1

By adding col-xs-4, the layout will be optimized for mobile devices with a width less than 576 pixels.

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

Looking to design an interactive grid for generating dynamic thumbnails

I am a beginner in the field of web development and I have a desire to create a website for showcasing my portfolio. This website should feature project thumbnails along with brief descriptions, all of which should be displayed dynamically. Although I poss ...

The addClass, removeClass, and css functions in jQuery are malfunctioning

I stumbled upon this website and I am looking to switch the font color from black to white. I attempted various methods but unfortunately, none of them seemed to work: Implementing jQuery's addClass function (to add a class to the SPAN tag) Uti ...

Markdown in Vue.js filters

I found a helpful example by Evan You on how to convert HTML to markdown - check it out here. However, when trying to install the marked package via npm and implementing it, I encountered an error stating that 'marked' is not defined. After inc ...

The CSS stylesheet appears to be properly linked, however, it is not displaying correctly on the preview page

Here are the locations of my folders: index.ejs can be found inside Markdown Blog/views/articles This is where my css stylesheet is located: ../../css/styles.css Despite ctrl+clicking the path and successfully navigating to the css file, the styles do no ...

change visibility:hidden to visible in a css class using JavaScript

I've put together a list of Game of Thrones characters who might meet their demise (no spoilers included). However, I'm struggling with removing a CSS class as part of my task. Simply deleting the CSS is not the solution I am looking for. I' ...

Customized style sheets created from JSON data for individual elements

One of the elements in the API requires dynamic rendering, and its style is provided as follows: "elementStyle": { "Width": "100", "Height": "100", "ThemeSize": "M", "TopMargin": "0", " ...

Sending various values to a JavaScript function

I am working with a function that looks like this: //Function Call with Single Parameter responses(baseURL); //Function Definition function responses(baseURL) { $.ajax({ url: baseURL, type: "get", cache: false, header ...

The form submission did not yield any results

function calculateCost() { var projectorCost=0,price=0,quantity=0,discountPrice=0,totalCost=0; var modelName=document.getElementById('projectormodel').value; var quantity=document.getElementById('q ...

Methods for creating overlapping background images in breadcrumbs

I am having trouble with making the breadcrumb frame overlap the inside images. I attempted using z-index: -1, but it causes the images to disappear. Please refer to the attached image for a better understanding. Thank you. .breadcrumb { margin-botto ...

Using the window.prompt function to send information to specific fields in a MySQL database is not functioning correctly. I am looking for assistance with this issue

Currently, I am attempting to send some data to a server that is MySQL-based. After running the code below, it seems like there are no errors showing up in the console. Can you please review this code and let me know if you spot any issues? I would really ...

Determining the height of a jQuery mobile page

Struggling for the last 24 hours to adjust the min-height styling on a jQuery mobile page specifically for mobile safari. Despite trying various methods like inline styles and overriding ui-page styles, I have not been successful in changing the height of ...

Learn how to dynamically clear and update source data in jQuery autocomplete for enhanced functionality

Here is a snippet of my jQuery code. In this code, 'year' refers to the form input tag ID, and 'years' is an array variable containing all the year values. I have set this array as the source for autocomplete, which works fine. However, ...

Substitute the division

Can I make the old div change its position and move to the side when I add a new div? And can all the old divs be hidden when adding four new divs? This is for my full news website and I want this applied to all four pages. First page: More pages: 2 pag ...

Are DIV elements really impossible to click using selenium Web Driver?

Can DIV elements be clicked using selenium Web Driver? For example, I'm having trouble clicking the delete button in Gmail. https://i.stack.imgur.com/zsyio.png I've been trying to locate the element using the XPATH = //div[@aria-label='De ...

What are the steps to effectively utilize my search bar alongside Google Custom Search?

Here is the HTML code for my form: <form action="#" class="searh-holder"> <input name="se" id="se" type="text" class="search" placeholder="Search.." value="" /> <button class="search-submit" id="submit_btn"><i class="fa fa-sea ...

Unable to access Form element in Firefox browser

I'm struggling with debugging unfamiliar problems. For instance, in my HTML there's a form: <form name="myForm" > <table> <tr> <td> <input type="radio" name="myType" value="val" onclick="someF ...

pattern to eliminate particular anchor elements

I am facing a challenge with a large HTML file that contains approximately 300 similar anchor tags that need to be removed: <a href="javascript:void(0);" onclick="javascript:thumbs(198, 0, 'architecture')" class="icon"></a> The prob ...

How to send the chosen option value from a select tag in Python Flask

My user registration form features a select tag, and I'm trying to assign the value of the selected option to a variable using the code below: registration.html <form method="POST" action="/register"> <div class="form-group"> ...

In the realm of website design, the IE7 display

I am currently facing an issue with my gallery buttons when using IE7. The CSS code I have for the buttons is causing them to shift to the right hand side of the gallery, even though they work fine in other browsers. Here is the code: .prv_button{ flo ...

Ways to divide a foreach loop or for loop into sets of 10 records

Let's say I have 56 entries in my database. To display them, I am using a FOR LOOP. My goal is to add a div element after every set of 10 records. <?php $totalRecords = 56; for($i=0; $i<$totalRecords; $i++){ e ...