我正在尝试使用代码来执行右侧框中的一个对齐,并且行中有两个相邻的框,请检查下面的代码,为什么主要的DIV类list_right css没有执行。
<style>
.list_right {
float:right;
padding:40px 5px 0px 0px;
width:37%;
position:relative;
}
.part_1 {
width:50%;
float:left;
line-height: 1.7;
}
.logos {
float: left;
width:160px;
margin-left:0px;
margin-bottom:8px;
padding-left: 45px;
padding-top: 1px;
padding-bottom: 3px;
text-decoration: none;
font-family:'Volkhov', arial;
font-size: 19px;
letter-spacing: 1.3px;
line-height: 2.14;
color: #6d6e71;
border: 1px solid;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
-webkit-box-shadow: #666 0px 2px 3px;
-moz-box-shadow: #666 0px 2px 3px;
box-shadow: #666 0px 2px 3px;
border-color: #41c7ee;
behavior: url(/css/pie/PIE.htc);
}
.logos:hover {
border-color: #6d6e71;
background-color: #41c7ee !important;
color: #ffffff !important;
text-decoration: none !important;
}
.site_1 {
background-image: url(http://i.imgur.com/ndWHvar.png) !important;
background-color: #f1f1f1 !important;
background-repeat:no-repeat !important;
background-position: 0px -5px !important;
height:36px;
}
.site_2 {
background-image: url(http://i.imgur.com/ndWHvar.png) !important;
background-color: #f1f1f1 !important;
background-repeat:no-repeat !important;
background-position: 0px -5px !important;
height:36px;
}
</style>
&#13;
<div class="list_right">
<div class="part_1">
<a href="/" class="logos site_1">Sites</a>
</div>
<div class="part_1">
<a href="/" class="logos site_2">Sites</a>
</div>
<div class="d_hidden">
</div>
<div class="clear_both">
</div>
&#13;
答案 0 :(得分:1)
我(从你的代码中)看到你没有关闭list_right标签。关闭它,它应该正常工作...尝试缩进你的代码,让它看起来更干净,以便将来你将能够自己看到问题。
答案 1 :(得分:0)