如何在Bootstrap中定价表?

时间:2017-01-27 18:39:19

标签: css twitter-bootstrap css3 twitter-bootstrap-3 grid-layout

我正在使用Bootstrap和响应式定价表的代码段。考虑以下代码,我如何将我的两个定价表项目集中在一起?我尝试使用text-align(和所有其他css对齐属性)以及html center和p标签。

    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-default">
                <div class="panel-heading"><h2>Pricing</h2></div>
                <div class="panel-body">
                        <div class="col-xs-6 col-sm-6 col-md-3 col-lg-3">

                            <!-- PRICE ITEM -->
                            <div class="panel price panel-red">
                                <div class="panel-heading  text-center">
                                    <h3>STANDARD PLAN</h3>
                                </div>
                                <div class="panel-body text-center">
                                    <p class="lead" style="font-size:40px"><strong>$49 / week</strong></p>
                                </div>
                                <ul class="list-group list-group-flush text-center">
                                    <li class="list-group-item"><i class="icon-ok text-danger"></i> Unlimited
                                    </li>
                                    <li class="list-group-item"><i class="icon-ok text-danger"></i> 5GB/week bandwidth
                                    </li>
                                    <li class="list-group-item"><i class="icon-ok text-danger"></i> 24/7 support
                                    </li>
                                </ul>
                                <div class="panel-footer">
                                    <a class="btn btn-lg btn-block btn-danger" href="/checkout.php">BUY NOW!</a>
                                </div>
                            </div>
                            <!-- /PRICE ITEM -->


                        </div>

                        <div class="col-xs-6 col-sm-6 col-md-3 col-lg-3">

                            <!-- PRICE ITEM -->
                            <div class="panel price panel-blue">
                                <div class="panel-heading arrow_box text-center">
                                    <h3>GOLD PLAN</h3>
                                </div>
                                <div class="panel-body text-center">
                                    <p class="lead" style="font-size:40px"><strong>$69 / week</strong></p>
                                </div>
                                <ul class="list-group list-group-flush text-center">
                                    <li class="list-group-item"><i class="icon-ok text-info"></i> Unlimited</li>
                                    <li class="list-group-item"><i class="icon-ok text-info"></i> 50GB/week bandwidth
                                    </li>
                                    <li class="list-group-item"><i class="icon-ok text-info"></i> 24/7 support</li>
                                </ul>
                                <div class="panel-footer">
                                    <a class="btn btn-lg btn-block btn-info" href="/checkout.php">BUY NOW!</a>
                                </div>
                            </div>
                            <!-- /PRICE ITEM -->
                        </div>
                </div>
            </div><!-- /panel -->
        </div><!-- /.col -->
    </div><!-- /.row -->

1 个答案:

答案 0 :(得分:2)

只需在您的第一个价格项

中添加col-md-offset-3即可

以下是关于它的引导程序doc

Bootply http://www.bootply.com/evwWXqxTBk

HTML提取

<div class="panel-heading"><h2>Pricing</h2></div>
<div class="panel-body">
       <div class="col-xs-6 col-sm-6 col-md-offset-3 col-md-3 col-lg-3">