2012-07-16 50 views
0

我使用了下面的代码,但它不能正确工作。我的意图是用蓝色突出显示当前页面而不悬停,其他页面在用鼠标悬停时应用蓝色突出显示。但我的代码没有突出显示没有悬停的当前页面。如何突出显示当前页码的分页

HTML:

<div class="pagination" align="right" style="margin:8px 16px; 8px; padding-top:5px"> 
<div class='pagenumbers'> 
<a class='number current'>1</a> 
<a href="http://url/2" class='number'>2</a> 
<a href="http://url/2">Next &gt;&gt; </a>&nbsp;<a href="url">Last Page &gt;&gt; </a>  </div> 
</div> 

CSS:

.pagination, .pagination a { 
    background: #f7f7f7; 
    padding: 5px 10px; 
    text - decoration: none; 
    color: #7e7e7e; 
    border: 1px solid # c6c6c6; 
    font - weight: bold; 
    border - radius: 3px; 
} 


.pagination: hover { 
    background: #f7f7f7; 
    padding: 5px 10px; 
    text - decoration: none; 
    color: #7e7e7e; 
    border: 1px solid # c6c6c6; 
    font - weight: bold; 
    border - radius: 3px; 
} 

.current a { 
    background: #9ad6fb; 
    padding: 5px 10px; 
    text-decoration: none; 
    color: # 7e7e7e; 
    border: 1px solid#c6c6c6; 
    font - weight: bold; 
    border - radius: 3px; 
    background: linear - gradient(top, #9ad6fb 0%,# 9ad6fb 52 % , #ebebeb 100 %); 
    background: -webkit - linear - gradient(top, #9ad6fb 0%,# 9ad6fb 52 % , #ebebeb 100 %); 
    box - shadow: inset 0 4px 3px rgba(255, 255, 255, 0.6), 
    0 1px 3px rgba(0, 0, 0, .2); 
} 

.pagenumbers current: a { 
    background: #9ad6fb; 
    border: 1px solid # 72ade4; 
    color: #4879a6; 
    background: linear-gradient(top, # 9ad6fb 0 % , 
    #77c4fc 100%); 
    background: -webkit-linear-gradient(top, # 9ad6fb 0 % , 
    #77c4fc 100%); 
    box-shadow: inset 0 1px 4px rgba(255,255,255,0.75), 0 1px 3px rgba(79,126,167,.5); 
    } 
+0

也许我错过了一些东西,但是这个选择器是什么:'.pagenumbers current:a'? – Blender 2012-07-16 20:25:43

回答

3
.pagenumbers current:a { 

应该

.pagenumbers a.current { 

Fiddle

相关问题