2013-01-17 20 views
0

我正在爲客戶創建一個Wordpress網站http://digitaldemo.net/vintage/about/和我 剛剛完成。我遇到的唯一問題是當我在給定頁面上時,li.current-menu-item類沒有被應用。li.current-menu-item沒有應用的wordpress菜單類

例如,在上面的URL上,關於菜單項應該有一個較暗的灰色背景,而不是圖標後面的白色「聚光燈」 。

這裏是我的導航CSS:

/* Navigation */ 

.topnav { 
    width:960px ; 
    position:absolute ; 
    top:0 ; 
    left:0 ; 
    z-index:5000 ; 
    text-align:center ; 
} 

ul.menu { 
    margin-left:0 ; 
    padding-left:0 ; 
    list-style-type:none ; 
} 

.menu li { 
    display:inline-block ; 
} 

.menu li { 
    margin:0px 12px 12px 12px ; 
    height:130px ; 
    width:130px ; 
} 

.menu li a { 
    font-family:ParkLaneNF ; 
    color:#000000 ; 
    font-size:20px ; 
    font-weight:normal ; 
    text-align:center ; 
    text-decoration:none ; 
    text-shadow:1px 1px 3px #333333 ; 
    display:inline-block ; 
    line-height:130px ; 
    height:76px ; 
    width:130px ; 
    padding-top:54px ; 
} 

.menu li.home { 
    background:url("images/homepage-icon.png") no-repeat center ; 
} 

.menu li.home:hover, .menu li.home .current_page_item { 
    background:url("images/homepage-icon-over.png") no-repeat center ; 
} 


.menu li.blog { 
    background:url("images/blog-icon.png") no-repeat center ; 
} 

.menu li.blog:hover, .menu li.blog .current-menu-item { 
    background:url("images/blog-icon-over.png") no-repeat center ; 
} 


.menu li.store { 
    background:url("images/store-icon.png") no-repeat center ; 
} 

.menu li.store:hover, .menu li.store .current_page_item { 
    background:url("images/store-icon-over.png") no-repeat center ; 
} 

.menu li.about { 
    background:url("images/about-icon.png") no-repeat center ; 
} 

.menu li.about:hover, .menu li.about .current-page-item { 
    background:url("images/about-icon-over.png") no-repeat center ; 
} 


.menu li.contact { 
    background:url("images/contact-icon.png") no-repeat center ; 
} 

.menu li.contact:hover, .menu li.contact current-menu-item { 
    background:url("images/contact-icon-over.png") no-repeat center ; 
} 

每個L1具有獨特的背景圖像(如li.blog有博客圖標和聚光燈,li.about具有 信息圖標和聚光燈等...)

如果有人能幫我理清這個問題,我會很感激。

最佳,

辛西婭

回答

0

你的選擇是錯誤的。

要選擇帶班的李current-menu-item你需要有它無空格:

li.about.current-menu-item { ... } 

而且它與名稱

current-page-item 

current_page_item 

變化相當混亂這些是爲了你自己的好處。