отзывчивости не происходит - PullRequest
0 голосов
/ 22 апреля 2020

У меня есть div, как показано на рисунке ниже, и все это было отзывчивым, пока я не добавил синий градиент к правой части и серой вертикальной линии. со вчерашнего дня я пытаюсь сделать его отзывчивым и не могу этого сделать. Синий градиент и вертикальная линия меня очень беспокоят, когда я пытаюсь сделать его отзывчивым.

.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>

image

1 Ответ

1 голос
/ 22 апреля 2020

Вот несколько изменений, которые я сделал. Пожалуйста, проверьте это и дайте мне знать, если вам нужны какие-либо изменения. Спасибо.

   

 .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>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...