0

I have a sidebar styled perfectly with CSS, but when I add the form to it (it's an add to cart section), the styles break completely. I just want the form to look like the page does without the form :)

Here is my code:

CSS:

    .quantity-block {
  background-color: #fff;
  padding: 6px;
  border: 1px solid #eee;
  margin-top: 80px;
  position: relative;
  -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}
.quantity-block:before {
  content: '';
  background: url('images/box-left-shadow.png?1384453543');
  background-repeat: no-repeat;
  display: block;
  width: 10px;
  height: 224px;
  position: absolute;
  left: -10px;
  top: 0;
}
.quantity-block:after {
  content: '';
  background: url('images/box-right-shadow.png?1384453543');
  background-repeat: no-repeat;
  display: block;
  width: 10px;
  height: 224px;
  position: absolute;
  right: -10px;
  top: 0;
}
.quantity-block > .heading {
  background: #2a916a url(images/product-title-bg.jpg) no-repeat;
  color: #fff;
  font-size: 18px;
  line-height: 1.3;
  min-height: 41px;
  padding: 6px 10px 5px;
  margin-bottom: 0;
}
.quantity-block > .heading span {
  font-size: 13px;
  font-weight: 400;
  font-style: normal;
  display: block;
}
.quantity-block .content {
  padding: 10px;
  border: 1px solid #2a916a;
  overflow: hidden;
}
.quantity-block .total-quantity {
  background-color: white;
  background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, rgba(255, 255, 255, 0.1)), color-stop(100%, rgba(0, 0, 0, 0.1)));
  background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.1));
  background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.1));
  background-image: -o-linear-gradient(rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.1));
  background-image: linear-gradient(rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.1));
  color: #333333;
  font-size: 18px;
  font-weight: 600;
  float: left;
  min-width: 70px;
  padding: 10px;
  border: 1px solid #ddd;
  margin-bottom: 10px;
  position: relative;
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  -ms-border-radius: 5px;
  -o-border-radius: 5px;
  border-radius: 5px;
}
.quantity-block .total-quantity:after {
  content: '';
  background: url(images/i-arr-down.png) no-repeat center center;
  width: 35px;
  border-left: 1px solid #ddd;
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
}
.quantity-block .total-price {
  background-color: #f4f4f4;
  font-size: 18px;
  font-weight: 600;
  float: right;
  min-width: 70px;
  padding: 10px;
  border: 1px solid #ddd;
  margin-bottom: 10px;
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  -ms-border-radius: 5px;
  -o-border-radius: 5px;
  border-radius: 5px;
}
.quantity-block .btn-cta {
  clear: both;
  display: block;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  padding: 13px 0;
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  -ms-border-radius: 5px;
  -o-border-radius: 5px;
  border-radius: 5px;
}

.list-quantities {
  margin-bottom: 10px;
}
.list-quantities > li {
  margin-bottom: 5px;
}
.list-quantities > li > a {
  background-color: #f4f4f4;
  color: #333333;
  display: block;
  padding: 10px;
  position: relative;
}
.list-quantities > li > a:hover {
  background-color: #e9e9e9;
}
.list-quantities p {
  font-size: 13px;
  font-weight: 600;
  font-style: italic;
  line-height: 1.3;
  margin-bottom: 0;
}
.list-quantities p span {
  color: #278b67;
  font-size: 14px;
  font-weight: 700;
  font-style: normal;
  display: block;
}
.list-quantities .price {
  font-size: 18px;
  font-weight: 600;
  position: absolute;
  right: 10px;
  top: 5px;
}

View code:

      <div class="quantity-block">
        <h5 class="heading">Choose your Quantity <span>Loose Leaf Tea</span></h5>

        <div class="content">

    {{ Form::open(array('action' => 'CartController@addtoCart', 'id' => 'addtocart')) }}
          <ul class="list-quantities">
    </div>

   <a href="#">
    <input type="radio" name='item_amount' value="2">
                <p><span>2 oz</span> 25 servings ${{ $percup = number_format((float)         $product->price_2oz / 25, 2) }} per cup</p>
                <span class="price">${{ $product->price_2oz }}</span>
              </a>
            </li>
            <li>
               <a href="#">
    <input type="radio" name='item_amount' value="4">
                <p><span>4 oz</span> 50 servings ${{ $percup = number_format((float) $product->price_4oz / 50, 2) }} per cup</p>
                <span class="price">${{ $product->price_4oz }}</span>
              </a>
            </li>
            <li>
               <a href="#">
    <input type="radio" name='item_amount' value="8">
                <p><span>8 oz</span> 100 servings ${{ $percup = number_format((float) $product->price_8oz / 100,2) }} per cup</p>
                <span class="price">${{ $product->price_8oz }}</span>
              </a>
            </li>
            <li>
               <a href="#">
    <input type="radio" name='item_amount' value="1">
                <p><span>1 lb</span> 200 servings ${{ $percup = number_format((float) $product->price_1lb / 200,2) }} per cup</p>
                <span class="price">${{ $product->price_1lb }}</span>
              </a>
            </li>
          </ul> <!-- List Quantities End -->

          <a href="#" class="total-quantity">1</a>
          <span class="total-price">Total: $</span>

          <input type='hidden' name='item_no' value='{{ $product->id }}'>
         <input type="submit" value="Add to Cart">

          {{ Form::close() }}
        </div> <!-- Content End -->
      </div> <!-- Quantity Block End -->

    </aside> <!-- Sidebar End -->
TerryG
  • 223
  • 1
  • 4
  • 16

0 Answers0