Как избавиться от границы ленты с помощью CSS? - PullRequest
0 голосов
/ 02 мая 2018

Я пытаюсь создать ленту вокруг div, используя Bootstrap 4.

Я не могу убрать правильную границу; на мобильном телефоне при сжатии страницы моя лента переполняется вправо, из родительского элемента div: https://jsfiddle.net/auj4q3a2/

Html

<div class="container-fluid">

    <div class="card profile-card">  
        <div class="container-fluid">
            <div class="row user-social-detail">
                <div class="col-lg-12 col-sm-12 col-12">
                    <a href="#"><i class="fa fa-facebook" aria-hidden="true"></i></a>
                    <a href="#"><i class="fa fa-twitter" aria-hidden="true"></i></a>
                    <a href="#"><i class="fa fa-instagram" aria-hidden="true"></i></a>
                    <a href="#"><i class="fa fa-linkedin" aria-hidden="true"></i></a>
                </div>
            </div>
        </div>
    </div>

</div>

CSS:

.profile-card {
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
    max-width: 475px;
    margin: auto;
    text-align: center;
}

.user-social-detail{
    margin: 0 -30px;
    padding: 15px 0px;
    background-color: #ffd280;
    border-radius: 4px;
}
.user-social-detail a i{
    color:#fff;
    font-size:23px;
    padding: 0px 5px;
}
.user-social-detail::before,
.user-social-detail::after {
  content: '';
  position: absolute;
  z-index: -1;
  left: -45px;
  top: -28px;
  display: block;
  width: 40px;
  height: 0px;
  border: 30px solid transparent;
  border-right: 20px solid #e5bd73;
  border-bottom-color: transparent;
  border-left-color: transparent;
}

.user-social-detail::after {
  left: auto;
  right: -45px;
  border-left: 20px solid #e5bd73;
  border-right: 30px solid transparent;
}

Как я могу вставить ленту в контейнер на мобильном телефоне, как на левой стороне?

Любые предложения или отзывы будут приветствоваться и высоко ценится.

1 Ответ

0 голосов
/ 02 мая 2018

Понял!

Вы должны добавить

overflow-x: hidden !important; до .container-fluid

EDIT: На самом деле, это необходимо только в 1-й .container-liquid, поэтому вы можете добавить в свой CSS-файл следующее:

.container-fluid:first-of-type {
    overflow-x: hidden !important;
}
...