Looking for assistance with creating a responsive design that works seamlessly on all large devices

Our UI/IX designer has provided a design that I need to replicate.

https://i.sstatic.net/8nXym.png

I am facing difficulties in centering the circular part of the image. (The vertical line and circular part are separate images)

I experimented with using padding-top on the "even part of the divs" and after some trial and error, I managed to achieve the design on "my device".

<!-- Apologies for the poor naming conventions. Using Bootstrap V5.3.0-alpha1-->
    <style>
      .cols:nth-of-type(even) {
        padding-top: 17rem;
      }
    </style>
    <body>
        <div class="container text-center">
          <div class="row row-cols-1 row-cols-md-3 row-cols-lg-6">
            <div class="cols">
              <div class="row row-cols-1 g-0">
                <div class="col">
                  <div class="card">
                    <div class="card-body">
                      <h3>CDR Report Writing</h3>
                    </div>
                  </div>
                </div>
                <div class="col">
                  <img src="./img/line-service.svg" alt="" />
                </div>
                <div class="col">
                  <img src="./img/circle-service.svg" alt="" />
                </div>
              </div>
            </div>
            <!-- more code here -->
        </body>

The issue is that the padding-top value only seems to work correctly on "my device". Viewing it on "other devices" results in incorrect positioning.

Design on My Device:

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

Design on Other Device:

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

What alternative methods can I use to ensure the design replicates responsively on all large devices (Width greater than 991px)? I'm not concerned about smaller widths as I have other plans for handling those.

P.S: Demo code on Codesandbox

Answer №1

check out this updated version for better optimization. I've streamlined the code for improved efficiency.

<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>CDR Services</title>
    <link
      href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="75171a1a01950e270917161317020d114052140910407c111b021242">[email protected]</a>/dist/css/bootstrap.min.css"
      rel="stylesheet"
      integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1FkqdTCVpJ6EGGoI1aFkw7cmDA6j6gD"
      crossorigin="anonymous"
    />
  </head>
  <body>
    <main>
      <section class="cdr-services">
        <div class="container text-center">
          <div class="row row-cols-1 row-cols-md-3 row-cols-lg-6">
            <div class="col">
              <div class="card">
                <div class="card-body">
                  <h3>CDR Report Writing</h3>
                </div>
              </div>
              <img src="./img/line-service.svg" alt="" />
            </div>
            <div class="col"></div>
            <div class="col">
              <div class="card">
                <div class="card-body">
                  <h3>CDR Report Writing</h3>
                </div>
              </div>
              <div class="col"></div>
                <img src="./img/line-service.svg" alt="" />
            </div>
            <div class="col"></div>
            <div class="col">
              <div class="card">
                <div class="card-body">
                  <h3>CDR Report Writing</h3>
                </div>
              </div>
              <img src="./img/line-service.svg" alt="" />
            </div>
          </div>
          <!-- ---------------------------------------- -->
          <div class="row row-cols-1 row-cols-md-3 row-cols-lg-6">
            <div class="col">
              <img src="./img/circle-service.svg" alt="" />
            </div>
            <div class="col">
              <img src="./img/circle-service.svg" alt="" />
            </div>
            <div class="col">
              <img src="./img/circle-service.svg" alt="" />
            </div>
            <div class="col">
              <img src="./img/circle-service.svg" alt="" />
            </div>
            <div class="col">
              <img src="./img/circle-service.svg" alt="" />
            </div>
            <div class="col">
              <img src="./img/circle-service.svg" alt="" />
            </div>
          </div>
          <!-- ---------------------------------------- -->
          <div class="row row-cols-1 row-cols-md-3 row-cols-lg-6">
            <div class="col"></div>
            <div class="col">
              <img src="./img/line-service.svg" alt="" />
              <div class="card">
                <div class="card-body">
                  <h3>CDR Report Writing</h3>
                </div>
              </div>
            </div>
            <div class="col"></div>
            <div class="col">
              <img src="./img/line-service.svg" alt="" />
              <div class="card">
                <div class="card-body">
                  <h3>CDR Report Writing</h3>
                </div>
              </div>
            </div>
            <div class="col"></div>
            <div class="cols">
              <img src="./img/line-service.svg" alt="" />
              <div class="card">
                <div class="card-body">
                  <h3>CDR Report Writing</h3>
                </div>
              </div>
            </div>
          </div>
        </div>
      </section>
    </main>
    <script
      src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="dfbdb0b0abacadedbcdbfbeeffcfbdcfdcbcfcadebebffefbf420fcceedfa9edecfd8dedfcccdcdfcefcfebefebeeffcfbdcfdcdcdbcadc64d413876"jamie.com</span"></em></a>',
      integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN"
      crossorigin="anonymous"
    ></script>

   <!--Fetching information from [website]-->
  </body>
</html>

Answer №2

Give this method a shot:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>CDR Solutions</title>
    <link
      href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6e0c01011a1d1a1c0f1e2e5b405d405e430f021e060f5f">[email protected]</a>/dist/css/bootstrap.min.css"
      rel="stylesheet"
      integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD"
      crossorigin="anonymous"
    />
    <!-- My apologies for the less than ideal naming conventions. -->
    <!-- <style>
      .cols:nth-of-type(even) {
        padding-top: 18rem;
      }
    </style> -->
  </head>
  <body>
    <main>
      <section class="cdr-solutions">
        <div class="container text-center">

          <!-- Rest of the code left unchanged -->

       </div>
	   <script
		  src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1d7f7272696e696f7c6d5d28332f332d">[email protected]</a>/dist/js/bootstrap.bundle.min.js"
		  integrity="sha384-A3rJD856KowSb7dwlZdYEkO39Gagi7vIsF0jrRAoQmDKKtQBHUuLZ9AsSv4jD4Xa"
		  crossorigin="anonymous"
		></script>
	  </body>
	</html>

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

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

What is the best way to locate the offspring of a parent div using its data attribute?

If I have a container div called dvMainDiv with multiple child divs inside it, all added programmatically, how can I retrieve a specific child div based on its data-id attribute? <div id="dvMainDiv" class="dvMainDiv"> <div id="dvChildDiv" cla ...

How can we activate navigation on a mobile browser?

I am currently working on a small HTML5/JavaScript website designed to be accessed by mobile browsers on devices such as Android and iPhone. I am utilizing the geolocation feature of HTML5 to obtain the user's current location, but my goal is to then ...

Jquery display function experiencing unresponsiveness

Currently, I am trying to implement some show/hide functionality in my JavaScript file: $(document).ready(function() { $('#me').hide(); $('#send').click(function() { $('#me').show("slow"); }); }); Strange ...

What is the best way to incorporate a background image in a Bootstrap tooltip?

I'm having trouble displaying an element with a background-image property within a Bootstrap tooltip. The image is not showing up as expected. <div class="big-panel"> <a href="#" data-bs-toggle="tooltip" data ...

Unable to shift to the side while in full flexibility mode

I ran into an issue with my code, shown in the image below. I am trying to position 1 on the left and 2 on the right, but something seems off. Can you spot the problem? <div className="mt-5 mx-5 py-3 shadow bg-white"> &l ...

Automatically adapt the height of a bootstrap button based on the dimensions of other bootstrap buttons

First and foremost, my objective is to centrally align a glyphicon both vertically and horizontally within a button. Despite attempting CSS attributes like position: relative; and position: absolute;, my efforts have been in vain. You can check out the sam ...

App.controller attributes in HTML tags are not receiving the value of the HTML variable

In the process of developing a simple student-teacher web application, I am utilizing AngularJS to handle the front-end. Within my JavaScript file, there are two app controllers - one for fetching student data and another for retrieving subjects assigned t ...

Securing Your Data with PHP and MySQL Password Protection

Currently, I am in the process of developing a web application that features a login and registration system. The application caters to two main types of users: clients and one admin. So far, I have successfully implemented a registration page for clients ...

javascript basic image carousel

How can I modify my slider so that "slide 1" appears after "slide 3" without needing to use the return or previous button each time? I'm not very well-versed in javascript, so I thought I'd reach out for some assistance ...

Use PHP to open a text file and display its contents in a textarea

I have a textarea on my website and I'm trying to figure out how to populate it with the content of a text file. I followed a tutorial that guided me through writing some code, but when I implement it, I'm facing an issue where the words from the ...

JQueryMobile 1.3.2 encounters issues with popups following the installation of Chrome version 43.0.2357.65 m update

Is anyone else experiencing issues with the latest version of Chrome "43.0.2357.65 m" causing problems with JQueryMobile 1.3.2? When I try to click on a popup, it suddenly jumps to the top of the page and the scroll bar disappears. This was not an issue in ...

Adding a button input and deleting non-functional parent elements

Here is a simple append function using jQuery, and it's working perfectly. However, the issue arises when I try to append a button and remove the parent tr upon clicking. The problem lies in using remove parent, as it doesn't seem to work as exp ...

Using CSS to ensure that the cards have consistent heights when using both React and Bootstrap

I am currently working with Bootstrap 4 in React. I have encountered an issue where the card for Item 1 is shorter than that of Item 2, and I would like both cards to have the same height. Additionally, I anticipate adding more cards at the bottom in the ...

Implement a vertical scrolling animation in datatables

I am trying to utilize datatables to display all data. My goal is to have the data automatically scroll row by row every 3 seconds. This is my code, and you can also check it out on jsfiddle The intention is to showcase this data on a large screen. < ...

What methods can I use to identify the selector for this element?

After pinpointing the specific element in Google Chrome using inspect element, what kind of path or syntax should I use to apply a method to this element? The hierarchy for the element is outlined below: html body div#contentDiv div#searchFormDiv ...

Can I use Ems instead of pixels for Chrome developer tools?

In all my style-sheets, I opt for using ems instead of px. However, in Chrome Developer Tools, the computed styles/metrics always display in px, even for elements where I specifically used ems: (Here is a screenshot of the computed lengths for a button wi ...

Unable to implement React tooltips in a different Component

After attempting to create a separate component for React Tooltips in order to easily reuse it within my project, I encountered an issue that results in an error upon reloading the App. Error https://i.sstatic.net/RsBhU.png I have already installed react- ...

"Adjust the width of a div element based on the unique ID of a

I am attempting to replicate a div multiple times, with each row in the database table creating a new instance. An example of what I'm aiming for is shown below. <?php for ($i=0; $i < 3; $i++) { ?><!-- replace '3' w ...

Click on the link that surrounds an inline-block span in Internet Explorer

In Chrome and Firefox, the following code works fine and makes the container clickable. However, in Internet Explorer, only the inner div changes the cursor to indicate that it's clickable, not the span. I could use cursor:pointer to fix this issue, ...

Issue with the MUI Autocomplete display in my form

Recently, I started using Material UI and Tailwind CSS for my project. However, I encountered an issue with the Autocomplete component where the input overlaps with the following DatePicker when there is multiple data in the Autocomplete. I have attached a ...