-2

我正在尝试添加以防止 twitterbootstrap 与以前的其他一些 css 文件冲突,非常感谢您的帮助。谢谢

我希望一切都用 .tbwrap 类包装。

4

1 回答 1

2

你需要使用的是LESS。

LESS主页的一个例子

  #header {
      h1 {
        font-size: 26px;
        font-weight: bold;
      }
      p { font-size: 12px;
        a { text-decoration: none;
          &:hover { border-width: 1px }
        }
      }
    }

/* 编译好的 CSS */

#header h1 {
  font-size: 26px;
  font-weight: bold;
}
#header p {
  font-size: 12px;
}
#header p a {
  text-decoration: none;
}
#header p a:hover {
  border-width: 1px;
}
  1. 将所有 css 包装在 .tbwrap 中 - 这将是您的 LESS 文件。
  2. 使用Winless等在线编译器将 LESS 转换为 CSS
于 2012-07-15T10:13:49.620 回答