为什么不用Bootstrap Jumbotron渲染?

时间:2016-03-19 16:38:19

标签: css twitter-bootstrap

我正在使用Jumbotron示例中的代码:http://getbootstrap.com/components/#jumbotron。我的例子中的jumbotron角没有圆角,文字没有居中。我做错了什么?

<!DOCTYPE html>
<html>

<head>
  <!-- Latest compiled and minified CSS -->
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">

  <!-- Optional theme -->
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">

  <!-- Latest compiled and minified JavaScript -->
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
</head>

<body>
  <div style="width:600px">
    <header class="jumbotron">
      <h1>My Famous Webpage</h1>
    </header>
  </div>
</body>

</html>

https://plnkr.co/edit/62cdPp29PtjfldEbGGra?p=preview

1 个答案:

答案 0 :(得分:2)

请试试这个:

将div放在div为容器的div中。

<div class="container">
<div style="width:600px">
            <header class="jumbotron">
            <h1>My Famous Webpage</h1>
        </header>
        </div>
</div>