Bootstrap中心标题和段落问题

时间:2017-06-28 11:49:41

标签: twitter-bootstrap

我的头已经结了。我试图将附加的标题和段落居中,但无论我做什么,它都会向左拉。有什么想法吗?这是代码(PS - 我是初学者:))

<!DOCTYPE html>
    <html lang="en">
        <head>

            <meta charset="utf-8">
            <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
            <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">

                <style type="text/css">

                    #appSummary {

                        text-align:center;

                    }

                </style>

        </head>

        <body>

            <div class="container">

                <div class="row" id="appSummary">

                    <h1>This is a H1 Header</h1>
                    <p>Paragraph with text. Paragraph with text. Paragraph with text.</p>

                </div>

            </div>

                <script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script>
                <script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
                <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
        </body>
    </html>

1 个答案:

答案 0 :(得分:0)

&#13;
&#13;
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">

        <body>

            <div class="container">

                <div class="text-center" id="appSummary">

                    <h1>This is a H1 Header</h1>
                    <p>Paragraph with text. Paragraph with text. Paragraph with text.</p>

                </div>

            </div>
        </body>
&#13;
&#13;
&#13;

参考:https://v4-alpha.getbootstrap.com/getting-started/introduction/

https://v4-alpha.getbootstrap.com/utilities/typography/#text-alignment