Bootstrap脚手架跨度

时间:2014-03-22 03:55:02

标签: twitter-bootstrap

超级初学者,但我有Bootstrap问题,我无法在线找到答案。我创建的跨度不会分成12个部分。它们看起来都是统一的,但我知道我已经正确安装了这个,因为我能够更早地创建按钮。救命!我究竟做错了什么?

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Scaffolding: Fixed</title>

<!-- Bootstrap -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<style>
    .span12{
        background: black;
        color: white;
        padding: 20px 0;
        text-align: center;
    }
    .span6{
        background: blue;
        color: white;
        padding: 20px 0;
        text-align: center;
        margin-top: 15px;
    }
    .span3{
        background: purple;
        color: white;
        padding: 20px 0;
        text-align: center;
        margin-top: 15px;
    }
</style>
</head>

<body>

  <div class = "container">
    <div class = "row">
      <div class = "span12">Span12</div>
    </div>
    <div class = "row">
      <div class = "span6">Span6</div>
      <div class = "span6">Span6</div>
    </div>
    <div class = "row">
      <div class = "offset 2 span3">Span3</div>
      <div class = "span3">Span3</div>
      <div class = "span3">Span3</div>
      <div class = "span3">Span3</div>
    </div>
  </div>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"> </script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>

</body>
</html>

1 个答案:

答案 0 :(得分:2)

我认为您使用的是Bootstrap 3,并且在最新版本的bootstrap中,没有针对网格系统的span类。 请改用以下代码:

<div class="row">
  <div class="col-lg-12">col-lg-12</div>
</div>