【问题标题】:960 grid elements not displaying like I think they should960 个网格元素没有像我认为的那样显示
【发布时间】:2023-03-06 04:03:01
【问题描述】:

我正在使用 960 网格系统来布局网站。我无法让 nivo-slider 和 h1 标签并排显示,中间有一个排水沟。有问题的两个元素都包含在一个div中,滑块有一个类

grid_7 

并且h1有一个grid_5的类

对于我正在使用的 12 列网格,这些加起来为 12。我不明白它们为什么重叠

这是我的scss

@import "compass/reset";

body {
  background: url(../img/background.png);
}

#header {
  background: green;
  margin-bottom: 25px;
}

.slider-wrapper {
  margin-bottom: 10px;
}

#navigation {
  clear: both;
  ul {
    li{
      list-style: none;
      float: left;
      margin: 2px;
      a {
       text-decoration: none;
     }
    }
  }
}

#content-wrapper {
  clear: both;
}

【问题讨论】:

  • 很难说没有任何 html 和完整的 css(你包括一个可能包含重要类的文件),但在我看来,如果 h1 是 #header 那么你需要给它float:left 或 display:inline-block

标签: css sass


【解决方案1】:

我解决了我遇到的问题。这两个元素不应该在一个包含 div 的元素中。

【讨论】:

    【解决方案2】:

    您是否将它们都包装在 container_12 中?

    <div class="container_12">
      <div class="grid_5"></div>
      <div class="grid_7"></div>
    </div>
    

    【讨论】:

    • 是的,它们被包裹在 container_12 中
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-09-25
    • 2019-01-19
    • 2013-02-24
    • 1970-01-01
    • 1970-01-01
    • 2022-07-06
    • 1970-01-01
    相关资源
    最近更新 更多