2013-12-07 23 views
0

我真的很感激,如果有人可以看看hindilyricsall.blogspot.com,并可以找出为什么导航栏下方的传送带中的下一个箭头没有对齐,并在转盘下方移动? 相关代码:部落格对齐问题在一个blogspot模板

<div id='carousel'> 
<div id='previous_button'/> 
<div class='container'> 
<script> 
document.write(&quot; &lt;script src=\&quot;/feeds/posts/default?max-results=&quot;+numposts1+&quot;&amp;orderby=published&amp;alt=json-in-script&amp;callback=showrecentposts\&quot;&gt;&lt;\/script&gt;&quot;); 
</script> 
</div> 
    <div id='next_button'/> 
    <div style='clear:both;'/> 

</div> 

的CSS:

#carousel{width:100%;height:240px;position:relative;display:block;} 
#carousel .container{position:relative;left:25px;margin-right:25px;width:930px;height:240px;overflow:hidden} 
#carousel #previous_button{position:absolute;width:25px;height:240px;background:url(http://3.bp.blogspot.com/-SFH7pfuPOg4/UAVZimY-OuI/AAAAAAAAHqE/MOKZ4nE0EFM/s1600/prev.png) center;z-index:100;cursor:pointer;} 
#carousel #next_button{position:absolute;right:0;width:25px;height:240px;background:url(http://4.bp.blogspot.com/-pFR58sZNzCo/UAVZh9I72lI/AAAAAAAAHp8/JTIiHJfsqHA/s1600/next.png) center;z-index:100;cursor:pointer;} 
#carousel #next_button:hover,#carousel #previous_button:hover{filter:alpha(opacity=70);opacity:.7} 
#carousel ul li:hover{background:#111} 
#carousel ul{width:100000px;position:relative;margin-top:10px} 
#carousel ul li{background:#272727;display:inline;float:left;text-align:center;font:12px Oswald;line-height:1.3em;width:130px;height:200px;margin:0 1px 6px 9px;padding:8px 5px 6px;border:1px solid #323232;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;} 
#carousel ul li a.slider_title{color:#ccc;display:block;margin-top:6px} 
#carousel ul li a.slider_title:hover{color:#fec700} 

回答

1

如果这个代码添加到你的CSS文件

#carousel .container { 
    float:left; 
} 

箭头将与caroussel

+0

谢谢!这样做了。 –

0

有对齐是HTML结构的一些问题,但通过添加float:留给.container应该修复你的p roblem

由于div是块级元素并占用整个空间,因此箭头将进入下一行。

.container { 
    float:left; 
} 
+0

你能告诉html结构有什么问题吗? –

+0

.carousel是相对定位的,因此通过放置箭头和容器绝对可以实现解决方案或者您可以采用浮动方法将这些元素浮动到左侧。 –

+0

是和内联JS和内联样式也被使用。它很好,如果你可以将它们分开并保存在文件中。 –