Удаление границ из сворачиваемых карточек начальной загрузки

#css #html #sass #bootstrap-4

#css — код #HTML #нахальство #bootstrap-4 #css #sass

Вопрос:

У меня есть набор карточек, которые отображаются кнопкой на моем веб-сайте. Когда я их открываю, карты (информация, которую я пытаюсь отобразить) имеют небольшую серую рамку вокруг них. Я хотел бы удалить эту границу, но настройка border: none; в моем CSS этого не делает.

К вашему сведению: я использую Bootstrap 4.3.1 (через CDN).

Код:

     <div id="skills" class="showcase-buttons">
      <button type="button" class="btn btn-primary btn-block" 
        data-toggle="collapse" href="#skills-showcase" aria-expanded="false"
        aria-controls="skills-showcase">
        Skills
      </button>

      <!-- collapsible content (skills) -->
      <div id="skills-showcase" class="collapse showcase-content justified-text">
        <div class="row justify-content-around">
          <div class="col-md-4">
            <div id="computer-skills">
              <div class="card card-body">
                <h3>Computer</h3>
                <p>
                  We'll put some happy little leaves here and there. If we're going to
                  have animals around we all have to be concerned about them and take
                  care of them. As trees get older they lose their chlorophyll. This
                  present moment is perfect simply due to the fact you're experiencing
                  it. Let's make some happy little clouds in our world.
                </p>
              </div>
            </div>
          </div>
          <div class="col-md-4">
            <div id="design-skills">
              <div class="card card-body">
                <h3>Design</h3>
                <p>
                  Put it in, leave it alone. Just let go - and fall like a little
                  waterfall. The more we do this - the more it will do good things to
                  our heart. Nature is so fantastic, enjoy it. Let it make you happy.
                  Trees grow in all kinds of ways. They're not all perfectly straight.
                  Not every limb is perfect. There are no limits in this world.
                </p>
              </div>
            </div>
          </div>
          <div class="col-md-4">
            <div id="problem-solving-skills">
              <div class="card card-body">
                <h3>Problem Solving</h3>
                <p>
                  If these lines aren't straight, your water's going to run right out of
                  your painting and get your floor wet. And I will hypnotize that just a
                  little bit. You need the dark in order to show the light. We don't
                  really know where this goes - and I'm not sure we really care. I get
                  carried away with this brush cleaning.
                </p>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  

Изображение:
изображение примера веб-сайта

Комментарии:

1. Какой селектор вы использовали для установки границы none ? Это должно быть более конкретным, чем селектор, используемый начальной загрузкой.

2. Я просто попытался добавить style=»border:none;» в <div class=»card card-body»>, и граница исчезла. Я думаю, что ваш браузер кэшировал ваш файл CSS. Попробуйте очистить свой браузер и сообщите нам об этом.

3. Просто из любопытства, что привело к тому, что мой пост был отклонен? Я бы предпочел понять, почему мой вопрос непродуктивен, чем просто знать, что это так.

Ответ №1:

Возможно, ваш кэш не очищается. Если нет, вы можете попробовать это и посмотреть, сработает ли это:

 .card {
    border: 0;
}
  

или:

 <div class="card border-0">...</div>
  

Комментарии:

1. Для справки, я сделал обе вещи. Добавление CSS было необходимо. Я не думаю, что я добавлял border: 0 в нужном месте.

Ответ №2:

Я удалил границу и серую линию вокруг кнопки навыков, это происходит при событии щелчка.

 .card.card-body{ border:none; }

 .btn-primary.focus, .btn-primary:focus { box-shadow:unset !important;}
 
 .btn.focus, .btn:focus{ box-shadow:unset !important;}  
 <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">

 <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X 965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH 8abtTE1Pi6jizo" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM B07jRM" crossorigin="anonymous"></script>
    
<div id="skills" class="showcase-buttons">
      <button type="button" class="btn btn-primary btn-block" 
        data-toggle="collapse" href="#skills-showcase" aria-expanded="false"
        aria-controls="skills-showcase">
        Skills
      </button>

      <!-- collapsible content (skills) -->
      <div id="skills-showcase" class="collapse showcase-content justified-text">
        <div class="row justify-content-around">
          <div class="col-md-4">
            <div id="computer-skills">
              <div class="card card-body">
                <h3>Computer</h3>
                <p>
                  We'll put some happy little leaves here and there. If we're going to
                  have animals around we all have to be concerned about them and take
                  care of them. As trees get older they lose their chlorophyll. This
                  present moment is perfect simply due to the fact you're experiencing
                  it. Let's make some happy little clouds in our world.
                </p>
              </div>
            </div>
          </div>
          <div class="col-md-4">
            <div id="design-skills">
              <div class="card card-body">
                <h3>Design</h3>
                <p>
                  Put it in, leave it alone. Just let go - and fall like a little
                  waterfall. The more we do this - the more it will do good things to
                  our heart. Nature is so fantastic, enjoy it. Let it make you happy.
                  Trees grow in all kinds of ways. They're not all perfectly straight.
                  Not every limb is perfect. There are no limits in this world.
                </p>
              </div>
            </div>
          </div>
          <div class="col-md-4">
            <div id="problem-solving-skills">
              <div class="card card-body">
                <h3>Problem Solving</h3>
                <p>
                  If these lines aren't straight, your water's going to run right out of
                  your painting and get your floor wet. And I will hypnotize that just a
                  little bit. You need the dark in order to show the light. We don't
                  really know where this goes - and I'm not sure we really care. I get
                  carried away with this brush cleaning.
                </p>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>