Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap card border thickness

I am trying to add a thicker border around the whole card in my bootstrap 4 card. It was supposed to be thicker, but nothing happened. I will give a snippet of my code here:

<div class="container">
    <div class="row">
        <div class="col-md-6 col-lg-3">
            <div class="card h-100">
                <img src="img/html.jpg" alt="HTML" class="card-img-top " style="display: block">
                <div class="card-block">
                    <h3 class="card-title"> Projects </h3>

                    <p class="font-weight-light"> hello world hello worldhello worldhello worldhello worldhello world</p>
                    <form action="https://www.w3schools.com/html/">
                        <button type="submit" class="btn btn-danger btn-lg btn-block">Learn More</button>
                    </form>
                </div>
            </div>
        </div>

And my css:

 .card {
     border-style: 5px solid black;
     padding-bottom: 3%;
 }

 .row {
     padding-bottom: 15%;
 }

Is there anything I could do to get to the end result?

Thanks.

like image 557
Christian Begg Avatar asked Oct 17 '25 19:10

Christian Begg


2 Answers

border-style isn't valid when combining properties. Change it to border and it works.

 .card {
     border: 5px solid black;
 }

Demo

like image 120
isherwood Avatar answered Oct 19 '25 12:10

isherwood


<div class="card" style="border: 2px solid #07bc4c"></div>

worked for me...

like image 43
Muhammad Zakaria Avatar answered Oct 19 '25 12:10

Muhammad Zakaria



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!