Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I disable the border on bootstrap 4 cards

A grey outline keeps appearing on the img section of my bootstrap card, which I would like to remove. Bootstrap card

    <!-- Card deck -->
                <div class="card-deck">
                    <!-- Card -->
                    <div class="col-md-6 col-lg-4 col-xl-3">
                        <div class="card mb-4">
                            <!--Card image-->
                            <div class="view overlay"><img alt="Work eyewear" class="card-img-top img-fluid" src="img/clothing-1.jpg"></div><!--Card content-->
                            <div class="card-body">
                                <!--Title-->
                                <h4 class="card-title">PPE</h4><!--Text-->
                                <p class="card-text">PPE is equipment that will protect the user against health or safety risks at work...</p><!-- Provides extra visual weight and identifies the primary action in a set of buttons -->
                                <a class="" href="https://shop.spartansafety.co.uk/personal-protection-s/1820.htm">SHOP NOW <i class="fas fa-arrow-right fa-xs"></i></a>
                            </div>
                        </div>
                    </div><!-- Card -->
like image 202
Victor Johnson Avatar asked Jun 07 '18 13:06

Victor Johnson


People also ask

How do I collapse a Bootstrap border?

Use border-0 for the cards to remove border top, right, bottom, and left.. To remove radius, use no-radius . Show activity on this post. So simply adding class="accordion" makes the 'inner' borders the same width as the 'outer' ones.


2 Answers

There are border utilities that can help with this. From the link:

Subtractive

<span class="border-0"></span>
<span class="border-top-0"></span>
<span class="border-right-0"></span>
<span class="border-bottom-0"></span>
<span class="border-left-0"></span>

So for your scenario, since you want to remove all borders you would add the border-0 CSS Class to your card like so:

<div class="card mb-4 border-0">
</div>
like image 100
jasonscript Avatar answered Oct 23 '22 19:10

jasonscript


If you check the .card class has a border: 1px solid #e5e5e5;

To remove it simply override it to border: none;

like image 54
John Baker Avatar answered Oct 23 '22 19:10

John Baker