Bootstrap Shopping Cart

1.6k Views Asked by At

I am trying to make a shopping cart similar to this:

What I want

But I can't seem to figure out how to get Local Delivery on the left and the circle (with the plus) inside of it on the right hand side.

HTML:

<div class="col" style="width:342px;height:69px;">
<p class="text-left center-block" style="width:451px;padding:-22px;">Local Delivery<button class="btn btn-primary align-items-center" type="button" id="cartHaz" style="padding:1px;margin:15px;"></button></p>

CSS:

element.style {
  width:518px;
  height:68px;
}

.d-flex {
  display:-ms-flexbox!important;
  display:flex!important;
}

.form-row {
  display:-ms-flexbox;
  display:flex;
  -ms-flex-wrap:wrap;
  flex-wrap:wrap;
  margin-right:-5px;
  margin-left:-5px;
}

div {
  resize:both;
  height:auto;
}

and here's what I get: Lame ass cart

I've already tried creating two columns in a single row and then floating the circle button to the right but it didn't work.

2

There are 2 best solutions below

1
On BEST ANSWER

Follow this code

.circle{  
  margin-top: 12px;
  height: 25px;
  width: 25px;
  border: 1px solid #45B4FE;
  border-radius: 50%;
  display: inline-block;
  /* color: red; */
  background-color: #cae3f9;
 }
 .circle-plus{
  position: relative;
  background-color: #45B4FE;
  width: 50%;
  height: 12.5%;
  left: 25%;
  top: 43.75%;
 }
 .vertical-plus{
  position: relative;
  background-color: #45B4FE;
  width: 21.5%;
  height: 399%;
  left: 40.75%;
  top: -127.5%;
 }
<p style="float: left">Change Delivery</p>
 <div class="circle">
  <div class="circle-plus">
   <div class="vertical-plus"> 
   </div> 
  </div>
 </div>

Hope it solves your problem !!

0
On

I only use bootstrap classes

Maybe this one can help :)

.content-wrapper{
  background-color: #ccf5ff;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">


<div class="row py-3 pl-3 pr-3 content-wrapper">
  <div class="col-md-6">
    <div class="pull-left">
      <h2 class="lead">Local Delivery</h2>
    </div>
  </div>
  <div class="col-md-6">
    <div class="pull-right">
        <i class="fa fa-plus"></i>
    </div>
  </div>
</div>


<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.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>