如何使Bootstrap按钮全宽?

And*_*Liu 9 css button width twitter-bootstrap

这就是我现在所拥有的.我无法让它成为全宽

几乎全宽

这是html.我已经尝试过添加.btn-block类但是我得到了相同的结果,好像我刚刚使用了宽度:100%; 在css.也许问题出在父元素上?

<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>
Run Code Online (Sandbox Code Playgroud)

这些都是风格

#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%;}
Run Code Online (Sandbox Code Playgroud)

Sea*_*nik 23

第一个问题......为什么你在a标签内嵌入一个div ? <a href="#"><div class="btn btn-success">Sign Up</div></a>.试试这个:

<a class="btn btn-block btn-success" href="#">Sign Up</a>
Run Code Online (Sandbox Code Playgroud)

然后padding-right: 50px;.price-content选择器中删除.