There is a lack of responsiveness

I have been facing an issue with the responsiveness of a div element in my design. Everything was going well until I introduced a blue gradient and grey vertical line to the right side. Since then, I've been struggling to make it look good on different screen sizes. The blue gradient and the vertical line are causing me a headache whenever I try to adjust the responsiveness.

.root_class {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 75%;
  margin: 0 auto;
  border: thin solid #ccc;
}

.text {
  font-size: 3rem;
  margin: 0;
  margin-right: 10rem;
}

.percentile-card {
  transition: 0.3s;
  margin: 1rem;
  padding: 5px;
  color: white;
}

.percentile-card p {
  margin: 0;
}

.percentile-card p:first-child {
  color: #bbb;
}


.rhs-background{
  background-image: linear-gradient(to right,white 60%,#0080ff 60%, #072f9c 100%);
}

@media (max-width: 768px) {
  .root_class {
    flex-direction: column;
  }
  .text {
    font-size: 2rem;
    margin-right: 0rem;
  }
}

@media (max-width: 768px){
  .perf-type-list{
    width: 30em;
    overflow-x: auto;
    white-space: nowrap;
  }
}

.vertical{
  border-left: 4px solid #ccc;
  height: 145px;
  position: relative;
  right: 29px;

}
    <div class="root_class rhs-background">
      <p class="text">Where Do i Stand Overall ?</p>
      <span class="vertical"></span>
        <div class="percentile-card text-center">
          <h3>You did better than</h3>
          <i class="fa fa-users pull-left" style="margin-left: 40px;font-size: 3em;" aria-hidden="true"></i>
          <b style="font-size:3em;">60%</b>
        </div>
      </div>

https://i.sstatic.net/3aCKH.png

Answer №1

Here are some recent modifications I made. Please review them and let me know if any further adjustments are needed. Thank you.

   

 .root_class {
      display: flex;
      justify-content: center;
      align-items: center;
      width: 75%;
      margin: 0 auto;
      border: thin solid #ccc;
      overflow: hidden;
    }

    .text {
      font-size: 3rem;
      width: 65%;
      margin: 0;
      text-align: center;
    }

    .percentile-card {
      transition: 0.3s;
      padding: 15px 55px;
      color: white;
      border-left: 4px solid #ccc;
      width: 35%;
      box-shadow: -2px 0px 4px 0px #cccccc;
      background-image: linear-gradient(to right,white 0%,#0080ff 0%, #072f9c 100%);
    }

    .percentile-card p {
      margin: 0;
    }

    .percentile-card p:first-child {
      color: #bbb;
    }

    @media (max-width: 768px) {
      .root_class {
        flex-direction: column;
      }
      .text {
        font-size: 2rem;
        margin-right: 0rem;
        width: 100%;
      }
      .perf-type-list{
        width: 30em;
        overflow-x: auto;
        white-space: nowrap;
      }
      .percentile-card{
        border-left: 0;
        border-top: 4px solid #ccc;
        margin-top: 30px;
        width: 100%;
        text-align: center;
      }
    }


    .vertical{
      border-left: 4px solid #ccc;
      height: 145px;
      position: relative;
      right: 29px;
    }
  <div class="root_class rhs-background">
    <p class="text">Where Do i Stand Overall ?</p>
    <div class="percentile-card text-center">
      <h3>You did better than</h3>
      <i class="fa fa-users pull-left" style="margin-left: 40px;font-size: 3em;" aria-hidden="true"></i>
      <b style="font-size:3em;">60%</b>
    </div>
  </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

Vue - making one element's width match another element's width

Trying to dynamically adjust the innermost element's width to match the outermost element's width with Vue: <div id="banner-container" class="row"> <div class="col-xs-12"> <div class="card mb-2"> <div ...

JQuery experiencing compatibility issues in both Firefox and Chrome

Working on my ASP.NET webpage has presented me with a frustrating problem that I cannot seem to solve. After researching for three days, I have not found anyone who has faced this issue before or offered any solutions. The menu/submenu created using HTML ...

Efficiently retrieving the correct file path using Python for "../../" and another specified directory path

Currently, I am conducting a content linking check on the user's uploaded zip file using Python's zipfile and BeautifulSoup modules. Within the zip file, there is a specific file called "a.html" located at "content/product1/component1/a.html". T ...

Having trouble adjusting the vertical position of jQuery Spinner buttons

I'm attempting to customize the jQuery spinner with styling applied like this: <span class="ui-spinner ui-widget ui-widget-content ui-corner-all" style="height: 14px;"> <input id="testSpinner" class="ui-spinner-input" name="value" aria-value ...

Tips for adding style to a child component from a parent component with multiple child components

I am faced with a situation where I have a child component in the form of a spinner that I need to display in two different places, each with its own unique style. In order to achieve this, I have attempted the following approach: my-loading-overlay ::ng-d ...

Center-aligned Circles via CSS with the number of circles controlled by AngularJS

Here is what the layout looks like: https://i.sstatic.net/Cz0CT.png Here is what I would like to have: https://i.sstatic.net/WbkY2.png Or if the getNumber function returns more, for example: https://i.sstatic.net/ViBXh.png (so essentially the circles ...

What is the best way to add padding to both the TextField input and label components within Material UI?

Recently, I've integrated Material UI into my project and set up a TextField for a form field. However, I'm facing an issue where applying padding to the input field doesn't affect the label as well. <TextField sx={{ display: &q ...

Can you provide a succinct explanation of what constitutes a well-defined "landing page"?

Could someone provide a clear and concise explanation of what exactly constitutes a landing page and how it should be utilized? I'm struggling to grasp the concept. Where is the optimal placement for a landing page on a website? Is it best placed o ...

Step-by-step guide on importing .obj and .mtl files into a Vue component with Vue CLI 3

Being new to VueJs and Three, my code is mostly just copied and pasted. I am trying to figure out how to load a 3D file (.obj) and its corresponding material file (.mtl) into a Vue component. I have already installed Three.js and imported the necessary loa ...

Incorporating float and clear techniques with the <aside> HTML element

Attempting to position two elements to the left and right of another element using floats, but encountering unexpected results. Check out the jsfiddle link provided below... https://jsfiddle.net/vx7tjbkf/ aside { margin: 0; padding: 0; width: ...

Replacing a <p> element using solely CSS: the ultimate guide (other techniques are ineffective)

After reviewing this particular question, I found that the suggested solution did not yield the results I was hoping for. Here is a visual representation of the issue: https://i.sstatic.net/Nj5V0.png My goal is to substitute the text "Select subscription ...

Monochromatic CSS background transformation upon hovering

Looking for a solution with my CSS sprite setup: Here is the HTML: <a id="estates" href="http://www.domain.com/estate"></a> The corresponding CSS: #estates {background-position: -200px 0px;width: 96px;height: 90px;} #estates {background: u ...

Utilizing HTML and CSS to Position Text Adjacent to the Initial and Final Elements in a Vertical List

Exploring a simple number scale ranging from 1 to 10, I experimented with different ways to represent it. Here's my attempt: <div class="rate-container"> <p class="first">Extremely Unlikely</p> <a class=" ...

What steps can I take to satisfy Chrome's rendering of inputs (an image and a text input)?

Visit to see a text input field and an image submit input. Initially, these elements were arranged inline without any formatting issues. However, a recent change has caused the text input to appear on the left of the image input. This alignment is still ...

Interactive card featuring a clickable dropdown menu that launches a modal window when selected

I'm running into an issue where my dropdown within a fully clickable card isn't functioning properly. The problem is that when I try to click on the three dots in the dropdown, it keeps opening the modal instead. I'm struggling to find a wa ...

The function CGI::escapeHTML() is ineffective

I am just starting to learn CGI programming and I am having an issue with my code. The output currently displays: Hello, "<h1>Tom Cat</h1>"! It seems that the escapeHTML() function is not working as expected. I am developing my CGI code usin ...

Having issues with the addClass() method in JavaScript not functioning properly on hover

Coding Challenge <ul class="navBarExtended"> <li><a href="#">Link</a></li> </ul> Styling Solution .onHover{ text-decoration: underline; } Interactive Scripting $("ul.navBarExtended li a").hover( function() ...

Adjust the navigation height to be proportional to the main content size

I've been attempting to make my navigation menu take up the entire page, but I have yet to achieve success: My goal is for the green menu section to extend down to the footer. Here is the HTML code: <div ...

Clicking on the overlaying divs in the slideshow does not trigger any changes when clicked

My question is about the behavior of the href attribute in a fade-style animation. Even when different containers are visible, the href value remains constant. Below is the HTML code: <div id="teaserslider"> <ul> <li> ...

Display additional links in Bootstrap navigation bar with a second level menu

Currently, I am integrating Bootstrap into an ASP.NET application using C#. Within this application, I have implemented a two-level menu system where certain options are available to users and others are only visible to administrators. The decision on whic ...