我有一个 html 文件,我需要用 Rails 样式重写它。我试图阅读 Rails 指南,但找不到太多有用的信息。这是我拥有的 HTML 的一部分。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<% content_for :head do -%>
<%= stylesheet_link_tag 'css.css' %>
<% end %>
<head>
<title>index</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" media="all" type="text/css" href="css/css.css" />
<script language="JavaScript" type="text/javascript" src="images/jquery-1.7.1.min.js"></script>
<script language="JavaScript" type="text/javascript" src="images/jQuery.infiniteCarousel.js">
</script>
<script language="JavaScript" type="text/javascript" src="images/jQuery.tbSwitching.js"></script>
<script language="JavaScript" type="text/javascript" src="images/myfocus-1.2.4.full.js"></script>
<script language="JavaScript" type="text/javascript" src="images/mF_expo2010.js"></script>
<link href="images/mF_expo2010.css" rel="stylesheet" type="text/css" />
</head>
<body>
<center>
<div id="top">
<div class="one">
<div class="one1">
<img src="images/ico1.png" width="225" height="58"/>
</div>
<div class="one2">
<div class="one3">
<div class="one4">Login/Sign up</div>
<div class="one4">Create an Account </div>
<div class="one5">shopping bag</div>
</div>
</div>
</div>
</div>
<div class="two">
<% content_for :below_body do -%>
<%= javascript_include_tag 'images/jquery-1.7.1.min.js' %>
<%= javascript_include_tag 'images/jQuery.infiniteCarousel.js' %>
<%= javascript_include_tag 'images/jQuery.tbSwitching.js' %>
<%= javascript_include_tag 'images/myfocus-1.2.4.full.js' %>
<%= javascript_include_tag 'images/mF_expo2010.js' %>
<% end %>
<script>
$(function(){
$("#top .two3").hover(function(){
$("#top .two3").removeClass("on").next(".two4").removeClass("ac");
$(this).addClass("on").next(".two4").addClass("ac");
},function(){
});
})
</script>
<script>
$(function(){
$("#top .two5 a").hover(function(){
$(this).addClass("on");
},function(){
$(this).removeClass("on");
});
})
</script>
......
</body>
</html>
我试图通过在 body 标签内使用下面的代码来修改它,但似乎没有用。
<% content_for :below_body do -%>
<%= javascript_include_tag 'images/jquery-1.7.1.min.js' %>
<%= javascript_include_tag 'images/jQuery.infiniteCarousel.js' %>
<%= javascript_include_tag 'images/jQuery.tbSwitching.js' %>
<%= javascript_include_tag 'images/myfocus-1.2.4.full.js' %>
<%= javascript_include_tag 'images/mF_expo2010.js' %>
<% end %>
我应该把它放在头里吗?我也应该对标签做任何事情吗?谢谢