【发布时间】:2012-09-05 16:02:56
【问题描述】:
我正在使用Grails 2.1.0 和@987654321@,但遇到navbar-fixed-top 的问题。
为了使导航栏固定在页面顶部以在调整大小期间正常运行,Twitter Bootstrap Docs 声明:
添加 .navbar-fixed-top 并记住通过向 .navbar-fixed-top 添加至少 40px 的内边距来解决其下方的隐藏区域。请务必在核心 Bootstrap CSS 之后和可选的响应式 CSS 之前添加它。
在使用 Grails Plugin for Twitter Bootstrap 时如何做到这一点?
这是我尝试过的:
main.gsp
<head>
...
<r:require modules="bootstrap-css"/>
<style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
}
.sidebar-nav {
padding: 9px 0;
}
</style>
<r:require modules="bootstrap-responsive-css"/>
<r:layoutResources/>
</head>
问题在于 Grails Plugin for Twitter Bootstrap 将 bootstrap.css 和 bootstrap-responsive.css 的内容合并到以下合并文件中:static/bundle-bundle_bootstrap_head.css。
因此,根据 Twitter Bootstrap 文档,我无法将主体填充样式置于“核心 Bootstrap CSS 之后和响应式 CSS 之前”。
这是我从上面的 main.gsp 获得的查看源代码 HTML
<style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
}
.sidebar-nav {
padding: 9px 0;
}
</style>
<link href="/homes/static/bundle-bundle_bootstrap_head.css" type="text/css"
rel="stylesheet" media="screen, projection" />
如果没有办法做到这一点,我总是可以删除 Grails Twitter Bootstrap 插件并手动下载 Twitter Bootstrap 并将其放入我的 Grails 项目的web-app/css、web-app/images 和web-app/js。但是,我希望能够使用 Grails Twitter Bootstrap 插件。
非常感谢您,我很感激!
【问题讨论】:
标签: grails twitter-bootstrap grails-plugin gsp