This is what I have right now. I can't get it to become full width
Almost full width
This is the html. I've already tried adding .btn-block class but I get the same results as if I just used width: 100%; in the css. Maybe the problem is with the parent element?
<article class="col-xs-12 col-md-4">
<div class="label label-success price"><span class="glyphicon glyphicon-tag"></span>$39</div>
<div class="price-title">
<h3>LOREM</h3>
<small>Lorem Ipsum</small>
</div>
<div class="price-content ">
<ul>
<li><h4>Item or Service # 1</h4></li>
<li><h4>Item or Service # 2</h4></li>
<li><h4>Item or Service # 3</h4></li>
<li><h4>Item or Service # 4</h4></li>
<li><h4>Item or Service # 5</h4></li>
<li><h4>Item or Service # 6</h4></li>
</ul>
<a href="#"><div class="btn btn-success">Sign Up</div></a>
</div>
</article>
And these are the styles
#tables{
color: white;
text-align: center;
margin: 15px 20px;}
.price{
position: relative;
top: 20px;
font-size: 30px;}
.price-content{
background-color: #E8E9EA;
color: #69696A;
padding-right: 50px;
padding-top: 30px;
height: 350px;
margin-bottom: 80px;
width: 100%;}
.btn{
border-radius: 0px;
font-size: 20px;
font-weight: bold;
width: 100%;}
Add .btn-lg or .btn-sm for additional sizes. Create block level buttons—those that span the full width of a parent—by adding .btn-block .
display: block and width: 100% is the correct way to go full width but you need to remove the left/right margin on the button as it pushes it outside the containing element. for more information on the box-sizing property, read the MDN docs.
Well first question... why the heck are you nesting a div inside the a
tag? <a href="#"><div class="btn btn-success">Sign Up</div></a>
. Try this:
<a class="btn btn-block btn-success" href="#">Sign Up</a>
Then remove padding-right: 50px;
from the .price-content
selector.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With