content logo

Bootstrap Cards:

Shopping Cart with Bootstrap

If you have an online shop and you sell products on the internet, you have to care about your website. It is better to have a website with a functional theme. In this post, you can see the Shopping Cart with Bootstrap and use it on your page. This Shopping Card Code is so functional and most website admins use it to gain many visitors. You will need a shopping list if you have an online shop. This helps your users and customers to know about the price of your products. So, we recommend you use the Bootstrap Shopping List on your website.

As you see, this HTML Shopping Card has a white background and you can use it if you have a simple page. All texts on this page are black and there is a large title at the top of the page. There are the photos of the products on the left side of the field and you see their detail next to the pictures. The price of each card is located on the right side of the Pure CSS Shopping Card. Then, there is a field for all costs. The “Checkout” option is placed at the bottom of the page in a black field with white text.

#

Shopping Card Code

#

Bootstrap Shopping List

#

HTML Shopping Card

#

Pure CSS Shopping Card

<!-- This script got from frontendfreecode.com -->
<main id="cart" style="max-width:960px">
    <div class="back"><a >&#11178; shop</a></div>
    <h1>Your Cart</h1>
    <div class="container-fluid">
        <div class="row align-items-start">
            <div class="col-12 col-sm-8 items">
                <!--1-->
                <div class="cartItem row align-items-start">
                    <div class="col-3 mb-2">
                        <img class="w-100" src="http://frontendfreecode.com/img/birdcage-posters.jpg" alt="art image">
                    </div>
                    <div class="col-5 mb-2">
                        <h6 class="">Dark Art 1</h6>
                        <p class="pl-1 mb-0">20 x 24</p>
                        <p class="pl-1 mb-0">Matte Print</p>
                    </div>
                    <div class="col-2">
                        <p class="cartItemQuantity p-1 text-center">1</p>
                    </div>
                    <div class="col-2">
                        <p id="cartItem1Price">$66</p>
                    </div>
                </div>
                <hr>
                <!--2-->
                <div class="cartItem row align-items-start">
                    <div class="col-3 mb-2">
                        <img class="w-100" src="http://frontendfreecode.com/img/birdcage-posters.jpg" alt="art image">
                    </div>
                    <div class="col-5 mb-2">
                        <h6 class="">Dark Art 2</h6>
                        <p class="pl-1 mb-0">20 x 24</p>
                        <p class="pl-1 mb-0">Matte Print</p>
                    </div>
                    <div class="col-2">
                        <p class="cartItemQuantity p-1 text-center">1</p>
                    </div>
                    <div class="col-2">
                        <p id="cartItem1Price">$66</p>
                    </div>
                </div>
                <hr>
            </div>
            <div class="col-12 col-sm-4 p-3 proceed form">
                <div class="row m-0">
                    <div class="col-sm-8 p-0">
                        <h6>Subtotal</h6>
                    </div>
                    <div class="col-sm-4 p-0">
                        <p id="subtotal">$132.00</p>
                    </div>
                </div>
                <div class="row m-0">
                    <div class="col-sm-8 p-0 ">
                        <h6>Tax</h6>
                    </div>
                    <div class="col-sm-4 p-0">
                        <p id="tax">$6.40</p>
                    </div>
                </div>
                <hr>
                <div class="row mx-0 mb-2">
                    <div class="col-sm-8 p-0 d-inline">
                        <h5>Total</h5>
                    </div>
                    <div class="col-sm-4 p-0">
                        <p id="total">$138.40</p>
                    </div>
                </div>
                <a ><button id="btn-checkout" class="shopnow"><span>Checkout</span></button></a>
            </div>
        </div>
    </div>
    </div>
</main>
<footer class="container">
</footer><a style="font-size: 8pt; text-decoration: none" target="_blank" href="http://frontendfreecode.com">Free Frontend</a>
                                                                            
#cart {
	max-width: 1440px;
	padding-top: 60px;
	margin: auto;
}
.form div {
	margin-bottom: 0.4em;
}
.cartItem {
	--bs-gutter-x: 1.5rem;
}
.cartItemQuantity, .proceed {
	background: #f4f4f4;
}
.items {
	padding-right: 30px;
}
#btn-checkout {
	min-width: 100%;
}
@import url("https://fonts.googleapis.com/css2?family=Exo&display=swap");
body {
	background-color: #fff;
	font-family: "Exo", sans-serif;
	font-size: 22px;
	margin: 0;
	padding: 0;
	color: #111111;
	justify-content: center;
	align-items: center;
}
a {
	color: #0e1111;
	text-decoration: none;
}
.btn-check:focus+.btn-primary, .btn-primary:focus {
	color: #fff;
	background-color: #111;
	border-color: transparent;
	box-shadow: 0 0 0 0.25rem rgb(49 132 253 / 50%);
}
button:hover, .btn:hover {
	box-shadow: 5px 5px 7px #c8c8c8, -5px -5px 7px white;
}
button:active {
	box-shadow: 2px 2px 2px #c8c8c8, -2px -2px 2px white;
}
/*PREVENT BROWSER SELECTION*/

a:focus, button:focus, input:focus, textarea:focus {
	outline: none;
}
main:before {
	content: "";
	display: block;
	height: 88px;
}
h1 {
	font-size: 2.4em;
	font-weight: 600;
	letter-spacing: 0.15rem;
	text-align: center;
	margin: 30px 6px;
}
h2 {
	color: rgb(37, 44, 54);
	font-weight: 700;
	font-size: 2.5em;
}
h3 {
	border-bottom: solid 2px #000;
}
h5 {
	padding: 0;
	font-weight: bold;
	color: #92afcc;
}
p {
	color: #333;
	font-family: "Roboto", sans-serif;
	margin: 0.6em 0;
}
h1, h2, h4 {
	text-align: center;
	padding-top: 16px;
}
.back {
	position: relative;
	top: -30px;
	font-size: 16px;
	margin: 10px 10px 3px 15px;
}
.inline {
	display: inline-block;
}
.shopnow, .contact {
	background-color: #000;
	padding: 10px 20px;
	font-size: 30px;
	color: white;
	text-transform: uppercase;
	letter-spacing: 1px;
	transition: all 0.5s;
	cursor: pointer;
}
.shopnow:hover {
	text-decoration: none;
	color: white;
	background-color: #c41505;
}
.shopnow span {
	cursor: pointer;
	display: inline-block;
	position: relative;
	transition: all 0.5s;
}
.shopnow span:after {
	content: url("http://frontendfreecode.com/img/caticon.png");
	position: absolute;
	font-size: 30px;
	opacity: 0;
	top: 2px;
	right: -6px;
	transition: all 0.5s;
}
.shopnow:hover span {
	padding-right: 25px;
}
.shopnow:hover span:after {
	opacity: 1;
	top: 2px;
	right: -6px;
}
.ma {
	margin: auto;
}
.price {
	color: slategrey;
	font-size: 2em;
}
#mycart {
	min-width: 90px;
}
#cartItems {
	font-size: 17px;
}
#product .container .row .pr4 {
	padding-right: 15px;
}
#product .container .row .pl4 {
	padding-left: 15px;
}
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js"></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- This script got from frontendfreecode.com -->

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js"></script>
<style>
#cart {
	max-width: 1440px;
	padding-top: 60px;
	margin: auto;
}
.form div {
	margin-bottom: 0.4em;
}
.cartItem {
	--bs-gutter-x: 1.5rem;
}
.cartItemQuantity, .proceed {
	background: #f4f4f4;
}
.items {
	padding-right: 30px;
}
#btn-checkout {
	min-width: 100%;
}
@import url("https://fonts.googleapis.com/css2?family=Exo&display=swap");
body {
	background-color: #fff;
	font-family: "Exo", sans-serif;
	font-size: 22px;
	margin: 0;
	padding: 0;
	color: #111111;
	justify-content: center;
	align-items: center;
}
a {
	color: #0e1111;
	text-decoration: none;
}
.btn-check:focus+.btn-primary, .btn-primary:focus {
	color: #fff;
	background-color: #111;
	border-color: transparent;
	box-shadow: 0 0 0 0.25rem rgb(49 132 253 / 50%);
}
button:hover, .btn:hover {
	box-shadow: 5px 5px 7px #c8c8c8, -5px -5px 7px white;
}
button:active {
	box-shadow: 2px 2px 2px #c8c8c8, -2px -2px 2px white;
}
/*PREVENT BROWSER SELECTION*/

a:focus, button:focus, input:focus, textarea:focus {
	outline: none;
}
main:before {
	content: "";
	display: block;
	height: 88px;
}
h1 {
	font-size: 2.4em;
	font-weight: 600;
	letter-spacing: 0.15rem;
	text-align: center;
	margin: 30px 6px;
}
h2 {
	color: rgb(37, 44, 54);
	font-weight: 700;
	font-size: 2.5em;
}
h3 {
	border-bottom: solid 2px #000;
}
h5 {
	padding: 0;
	font-weight: bold;
	color: #92afcc;
}
p {
	color: #333;
	font-family: "Roboto", sans-serif;
	margin: 0.6em 0;
}
h1, h2, h4 {
	text-align: center;
	padding-top: 16px;
}
.back {
	position: relative;
	top: -30px;
	font-size: 16px;
	margin: 10px 10px 3px 15px;
}
.inline {
	display: inline-block;
}
.shopnow, .contact {
	background-color: #000;
	padding: 10px 20px;
	font-size: 30px;
	color: white;
	text-transform: uppercase;
	letter-spacing: 1px;
	transition: all 0.5s;
	cursor: pointer;
}
.shopnow:hover {
	text-decoration: none;
	color: white;
	background-color: #c41505;
}
.shopnow span {
	cursor: pointer;
	display: inline-block;
	position: relative;
	transition: all 0.5s;
}
.shopnow span:after {
	content: url("http://frontendfreecode.com/img/caticon.png");
	position: absolute;
	font-size: 30px;
	opacity: 0;
	top: 2px;
	right: -6px;
	transition: all 0.5s;
}
.shopnow:hover span {
	padding-right: 25px;
}
.shopnow:hover span:after {
	opacity: 1;
	top: 2px;
	right: -6px;
}
.ma {
	margin: auto;
}
.price {
	color: slategrey;
	font-size: 2em;
}
#mycart {
	min-width: 90px;
}
#cartItems {
	font-size: 17px;
}
#product .container .row .pr4 {
	padding-right: 15px;
}
#product .container .row .pl4 {
	padding-left: 15px;
}
</style>

</head>
<body>
<main id="cart" style="max-width:960px">
    <div class="back"><a >&#11178; shop</a></div>
    <h1>Your Cart</h1>
    <div class="container-fluid">
        <div class="row align-items-start">
            <div class="col-12 col-sm-8 items">
                <!--1-->
                <div class="cartItem row align-items-start">
                    <div class="col-3 mb-2">
                        <img class="w-100" src="http://frontendfreecode.com/img/birdcage-posters.jpg" alt="art image">
                    </div>
                    <div class="col-5 mb-2">
                        <h6 class="">Dark Art 1</h6>
                        <p class="pl-1 mb-0">20 x 24</p>
                        <p class="pl-1 mb-0">Matte Print</p>
                    </div>
                    <div class="col-2">
                        <p class="cartItemQuantity p-1 text-center">1</p>
                    </div>
                    <div class="col-2">
                        <p id="cartItem1Price">$66</p>
                    </div>
                </div>
                <hr>
                <!--2-->
                <div class="cartItem row align-items-start">
                    <div class="col-3 mb-2">
                        <img class="w-100" src="http://frontendfreecode.com/img/birdcage-posters.jpg" alt="art image">
                    </div>
                    <div class="col-5 mb-2">
                        <h6 class="">Dark Art 2</h6>
                        <p class="pl-1 mb-0">20 x 24</p>
                        <p class="pl-1 mb-0">Matte Print</p>
                    </div>
                    <div class="col-2">
                        <p class="cartItemQuantity p-1 text-center">1</p>
                    </div>
                    <div class="col-2">
                        <p id="cartItem1Price">$66</p>
                    </div>
                </div>
                <hr>
            </div>
            <div class="col-12 col-sm-4 p-3 proceed form">
                <div class="row m-0">
                    <div class="col-sm-8 p-0">
                        <h6>Subtotal</h6>
                    </div>
                    <div class="col-sm-4 p-0">
                        <p id="subtotal">$132.00</p>
                    </div>
                </div>
                <div class="row m-0">
                    <div class="col-sm-8 p-0 ">
                        <h6>Tax</h6>
                    </div>
                    <div class="col-sm-4 p-0">
                        <p id="tax">$6.40</p>
                    </div>
                </div>
                <hr>
                <div class="row mx-0 mb-2">
                    <div class="col-sm-8 p-0 d-inline">
                        <h5>Total</h5>
                    </div>
                    <div class="col-sm-4 p-0">
                        <p id="total">$138.40</p>
                    </div>
                </div>
                <a ><button id="btn-checkout" class="shopnow"><span>Checkout</span></button></a>
            </div>
        </div>
    </div>
    </div>
</main>
<footer class="container">
</footer><div id="bcl"><a style="font-size:8pt;text-decoration:none;" href="http://www.devanswer.com">Free Frontend</a></div>

</body>
</html>
Preview