My goal is to create a responsive order summary page

I recently designed a gratitude page for my e-commerce website using Groovy and Grails. Below is the code snippet of the page where I incorporated Bootstrap classes.

https://i.sstatic.net/TJ0yf.png

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

    <div class="panel panel-default">

        <div class="panel-body">

            <div class="col-md-12 col-sm-12">
                <h3>Thank you for your Order!</h3>
                <br/>
                <br/>

                <div class="row">
                    <div class="col-md-12 col-sm-12 col-xs-12">
                        <h5>Your Order Number is : 123456</h5>
                    </div>
                </div>
                <br/>

                <div class="row">
                    <div class="col-md-12 col-sm-12 col-xs-12">
                        // some backend code
                    </div>
                </div>

                <br/>

                <div class="clearfix"></div>

                <div class="row">
                    <div class="col-md-12 col-sm-12 col-xs-12" id="btnOrderSummary">
                        <a class="btn btn-primary pull-left float-none" 
                         style="margin: 5px">
                              View Order Summary
                          <i class="fa fa-files-o"></i></a>

                        <a class="btn btn-primary pull-right float-none"
                                style="margin: 5px"> Home
                          <i class="fa fa-home "></i></a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>

When viewing the page in responsive mode, such as on an iPhone X,

https://i.sstatic.net/HtWDt.png

What specific modifications should I apply to the CSS or bootstrap to ensure responsiveness across all mobile devices?

Answer №1

Below is the code snippet:

<div class="row">
  <div class="col-md-12 col-sm-12 col-xs-12" id="btnOrderSummary">
    <a class="btn btn-primary pull-left float-none">
          View Order Summary
      <i class="fa fa-files-o"></i></a>

    <a class="btn btn-primary pull-right float-none"> Home
      <i class="fa fa-home "></i></a>
  </div>

Please remove style="margin: 5px" - this inline CSS from both buttons.

Additionally, remember to add a media query to your CSS for better responsiveness:

@media(max-width:375px){
   #btnOrderSummary{padding:0;}
}

Feel free to adjust the max-width value according to your requirements.

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

Enclose a group of tiles in a shrinkwrap div

I've been struggling to make a div adjust to its content size here. I've attempted various methods to shrinkwrap it, but none seem to work. <div class="outer"> <div class="cont"> <img src="http://www.placehold.it/100" ...

Utilizing CSS and JQUERY for Styling Border radius

Is there a way in jQuery to select specific parts and apply a "border radius"? I've been struggling to use a jQuery selector to achieve this. Is there another method using CSS? I don't want to manually add a "CLASS" to the HTML code to solve th ...

Positioning HTML elements using CSS and avoiding the use of tables

I'm struggling with my clear CSS declarations. This is how I'd like it to appear: View the Fiddle demo HTML: <div id="timesheeteditor"> <div id="weekselector"> <div>Week 1</div> <div>Week 2</div> ...

Unable to open ngx-bootstrap dropdown in Angular 4 with Bootstrap 4

I'm struggling to understand the issue at hand here - I've implemented ngx-dropdown code according to the documentation: home.component.html <div class="btn-group" dropdown> <button dropdownToggle type="button" class="btn btn ...

Activate just the show more / show less button on the website that has several buttons with identical ids

Whenever the "show more" button is clicked, additional images are displayed in the gallery and the button text changes to "show less". However, in my ExpressionEngine (CMS) templates and entries, all "show more" buttons share the same id, causing other but ...

Having trouble locating the CSS and JavaScript files within my Spring Maven project

I have a Spring framework application with a Maven project. In addition, I have CSS and JavaScript files under the WEB-INF folder. When attempting to link the JavaScript and CSS files like this: <link rel="stylesheet" href="../allDesign/js/vendor/anims ...

Having trouble with uploading the profile image in Angular 2? The upload process doesn't

I just started learning Angular and decided to create a profile page. But, I encountered an error while trying to upload a profile image. The error message that I received was POST http://localhost:3000/api/v1/users/avatar/jja 500 (Internal Server Error). ...

What is the best way to use HTML and CSS to center images and headings on a webpage?

This task is really testing my patience... I'm attempting to create a layout that resembles the following: Logo img|h1|img The horizontal lines flanking the subtitle serve as a visual guide, like this --- Subtitle --- Below is the snippet of H ...

Is there a way to display an asterisk within a select2 dropdown to signify that a field is mandatory?

I'm facing an issue with the Select2 plugin in my form. While all fields are required and marked by an asterisk when empty, the Select2 dropdown ignores this validation attribute. Therefore, I am wondering: Is there a way to display an asterisk image ...

dynamic resizing, uniform dimensions

Is it possible to use CSS to ensure that an image is 100% the width of a fluid div without distorting the square shape? The goal is to match the height to the width for a cohesive look. Currently, I am using the following code for fluid width: .img{ max ...

Adjusting the border color when two checkboxes are chosen (and simultaneously deactivating the others)

I'm struggling to understand how to disable the remaining checkboxes after two are selected and change the border color of the "checkbox_group" to red. Can someone help me with this? Here is the JavaScript code I have so far: $(document).ready(funct ...

Tips for displaying and concealing a toggle button based on screen size changes

My goal is to display my userlist without a toggle button by default when the screen is in full size, and only provide a toggle button when the screen is in mobile size to allow users to show/hide the list. Currently, I am utilizing the following code: & ...

disable the option to call on your iPhone

Hello there, I am currently working on a project which has a mobile browser version. I have noticed that on iPhone, all numbers are callable by default. My goal is to identify and select all callable numbers while disabling the call option. For i ...

What causes Next.JS to automatically strip out CSS during the production build process?

Encountering unpredictability in CSS loading while deploying my Next.JS site. Everything appears fine locally, but once deployed, the CSS rules seem to vanish entirely. The element has the attached class, yet the corresponding styling rules are nowhere to ...

Leverage CSS variables to dynamically create class names within SCSS

Can CSS variables be used to generate class names? I am incorporating SCSS in an Angular project and I am looking to base my class names on the @input color component property. I have stored the input in a CSS variable called --color-variable to utiliz ...

The hover drop-down menu in CSS is not appearing in the correct position

Having trouble with my navigation bar - the dropdown menu isn't showing up below the category when I hover over it. It keeps ending up in the left-hand corner and I can't access it! I've searched everywhere for a solution, but can't fin ...

Ways to alter the color of the <div> Element based on its height or width?

My goal is to dynamically change the color of a div element based on its height. Here's the criteria: If the div's height is less than or equal to 20%, I want it to be colored green. If it's above 20%, the color should be blue. I'm lo ...

Choosing containers as found in the Firefox debugging tool

I'm currently working on developing a container selector similar to the one found in Firefox's debug tools (press ctrlshift+C). The main goal is to retrieve a list of selected elements for further manipulation. Here is my current progress: http ...

Ensuring JS consistently monitors changes in value

Is there an equivalent of (void update) in Unity that is called every frame in Web Development (using JavaScript)? "I want it to continuously check if certain values have changed and then update them accordingly." let governmentprice = parseFloat(select ...

Tips on how to maintain the underline when text is split into two sections

Revised This question is distinct from the duplicate one. I am specifically addressing the issue of ensuring the underline continues until the end of the text, regardless of how many lines it spans. The challenge I am facing is with displaying the underl ...