如何重复网格行?

时间:2010-02-25 12:11:06

标签: css 960.gs

我如何重复这一点,以某种方式明确不会使布局在另一个下面?

<div class="grid_3 alpha"></div><div class="grid_2"></div><div class="grid_11"></div>
<div class="clear" style="height:20px"></div>

<div class="grid_3 alpha"></div><div class="grid_2"></div><div class="grid_11"></div>
<div class="clear" style="height:20px"></div>

<div class="grid_3 alpha"></div><div class="grid_2"></div><div class="grid_11"></div>
<div class="clear" style="height:20px"></div>

<div class="grid_3 alpha"></div><div class="grid_2"></div><div class="grid_11"></div>
<div class="clear" style="height:20px"></div>

1 个答案:

答案 0 :(得分:2)

尝试在空格子div中放置&nbsp;。使用空的960.gs网格div有一些跨浏览器的问题。

编辑:以下在Fi​​refox和Chrome中完美运行。也许你的doctype或容器元素不对?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>960 Grid System &mdash; Test</title>
    <link rel="stylesheet" href="css/reset.css" />
    <link rel="stylesheet" href="css/text.css" />
    <link rel="stylesheet" href="css/960.css" />
    <style type="text/css"> 
      div.grid_3 { background-color: #0f0; }
      div.grid_2 { background-color: #f00; }
      div.grid_11 { background-color: #00f; }
    </style>
  </head>
  <body>
    <div class="container_16">
      <div class="grid_3 alpha">&nbsp;</div><div class="grid_2">&nbsp;</div><div class="grid_11">&nbsp;</div>
      <div class="clear" style="height:20px"></div>
      <div class="grid_3 alpha">&nbsp;</div><div class="grid_2">&nbsp;</div><div class="grid_11">&nbsp;</div>
      <div class="clear" style="height:20px"></div>
      <div class="grid_3 alpha">&nbsp;</div><div class="grid_2">&nbsp;</div><div class="grid_11">&nbsp;</div>
      <div class="clear" style="height:20px"></div>
      <div class="grid_3 alpha">&nbsp;</div><div class="grid_2">&nbsp;</div><div class="grid_11">&nbsp;</div>
      <div class="clear" style="height:20px"></div>
    </div>
  </body>
</html>