2011-05-23 68 views
0

我有一篇文章“标签”侧边栏,它正确定位在主页上,但在我所有其他页面上爬行。我正在使用Kaminari paginate插件。它让我疯狂 - 我怎么能阻止这种事情发生?标签边栏向上移动?

CSS

.sidebar { 
position:absolute; 
width: 150px; 
float:right; 
padding: 0px 0px 0px 20px; 
margin: -1500px 0px 0px 700px; 
} 

_side.html.erb

<div id="art"> 
<%= link_to 'Post An Article', new_article_path %> 
</div> 

<div id="iphone"> 
<%= image_tag "iPhone.png" %> 
</div> 
<br /> 

<div id="soc-med"> 
<%= link_to image_tag("facebook.png"), "http://www.facebook.com/" %> 
<%= link_to image_tag ("twitter.png"), "http://twitter.com/#!/" %> 
</div> 


<div id="tag_title"> 
<h3>Article Tags</h3> 
</div> 

<div id= "tags" > 
<% cache('all_tags') do %> 
<% for tag in Tag.find(:all, :order => 'name') %> 


<ul style="list-style-type: none"> 
<li> 
<%= link_to "#{tag.name}", tag_path(tag) %> 
</li> 
</ul> 

<% end %> 
</div> 
<% end %> 
</div> 

enter image description here

+3

不可能帮助没有更多的代码或将活动链接 – Ross 2011-05-23 20:48:37

+1

这取决于家庭和内页之间的代码。你能分享这两个HTML代码? – jackJoe 2011-05-23 20:51:15

+0

@Ross @jackJoe - 添加了上面的代码。你能提出一个解决方案吗? – ubique 2011-05-25 21:59:39

回答

0

设定 '顶部:130px;'属性解决了这个问题:

.sidebar { 
font-family:Arial, Helvetica, sans-serif; 
position:absolute; 
width: 150px; 
float:right; 
top: 130px; 
padding: 0px 0px 0px 20px; 
margin: 0px 0px 0px 700px; 
}