我通常在我的项目中使用 Twitter Bootstrap Rails gem,但是我想我会试试 Zurb Foundation gem。我已严格按照安装说明进行操作。当我添加导航时:
<div class="row">
<div class="three columns">
<h1><img src="http://placehold.it/400x100&text=Logo" /></h1>
</div>
<div class="nine columns">
<ul class="nav-bar right">
<li><a href="#">About</a></li>
<li><a href="#">Work</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</div>
我得到以下信息:
请注意,徽标占位符未与右侧的导航对齐,并且导航链接上没有灰色渐变。
我的 application.html.erb 看起来像这样:
<!DOCTYPE html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7 ]> <html class="ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]> <html class="ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]> <html class="ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--> <html lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8" />
<!-- Uncomment to make IE8 render like IE7 -->
<!-- <meta http-equiv="X-UA-Compatible" content="IE=7" /> -->
<!-- Set the viewport width to device width for mobile -->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title><%= content_for?(:title) ? yield(:title) : CONFIG['title'] %></title>
<!-- Included CSS Files -->
<%= stylesheet_link_tag "application" %>
<%= csrf_meta_tags %>
</head>
<body>
<%= render 'layouts/navigation' %>
<div class="container">
<%= yield %>
</div>
<!-- Included JS Files -->
<%= javascript_include_tag "application" %>
<% if CONFIG['google_analytics_id'] %>
<!-- Google Analytics -->
<script>
var _gaq=[['_setAccount','<%= CONFIG['google_analytics_id'] %>'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
<% end %>
</body>
</html>