2011-05-28 58 views
-1

我的CSS代碼是:如何留住CSS按鈕顏色

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

.horizontalcssmenu ul a:active{ 
    color: #00FFFF; 
    background: #FF0033; 
    text-decoration: none; 
} 

/*Top level list items*/ 
.horizontalcssmenu ul li{ 
    position: relative; 
    display: inline; 
    float: left; 
    height: 34px; 
    top: 25px; 
    left: 111px; 
    width: 71px; 
    margin-left: 0px; 
} 

.horizontalcssmenu ul li a:active{ 
    color: #00FFFF; 
    background: #FF0033; 
    text-decoration: none; 
} 

/*Top level menu link items style*/ 
.horizontalcssmenu ul li a{ 
    border-left: 2px solid #202020; 
    border-right: 2px solid #202020; 
    border-top: 2px solid #202020; 
    border-bottom: 2px solid #202020; 
    display: block; 
    width: 54px; /*Width of top level menu link items*/ 
    padding: 2px 8px; 
    text-decoration: none; 
    background: url(menubg.gif) center center repeat-x; 
    color: Red; 
    font: bold 13px Tahoma; 
    height: 27px; 
    margin-left: 0px; 
} 

/*Sub level menu*/ 
.horizontalcssmenu ul li ul{ 
    left: 0; 
    top: 0; 
    border-top: 1px solid #202020; 
    position: absolute; 
    display: block; 
    visibility: hidden; 
    z-index: 100; 
} 

.horizontalcssmenu ul li ul a:active{ 
    color: #00FFFF; 
    background: #FF0033; 
    text-decoration: none; 
} 

/*Sub level menu list items*/ 
.horizontalcssmenu ul li ul li{ 
    display: inline; 
    float: none; 
} 

.horizontalcssmenu ul li ul li a:active{ 
    color: #00FFFF; 
    background: #FF0033; 
    text-decoration: none; 
} 

/* Sub level menu links style */ 
.horizontalcssmenu ul li ul li a{ 
    width: 100px; /*width of sub menu levels*/ 
    font-weight: normal; 
    padding: 2px ; 
    background: #663300; 
    border-width: 1px 1px 1px; 
} 

.horizontalcssmenu ul li ul li a:active{ 
    color: #00FFFF; 
    background: #FF0033; 
    text-decoration: none; 
} 

.horizontalcssmenu ul li a:hover{ 
    color: #0066FF; 
    background: #FF0033; 
    text-decoration: none; 
} 

.horizontalcssmenu ul li a:active{ 
    color: #00FFFF; 
    background: #FF0033; 
    text-decoration: none; 
} 

.horizontalcssmenu ul li ul li a:hover{ 
    color: #00FFCC; 
    background: #CCCC66 
} 

.horizontalcssmenu .arrowdiv{ 
    position: absolute; 
    right: 1; 
    background: transparent url(image/bg-bubplastic-button.gif) no-repeat center left; 
} 

* html p#iepara{ /*For a paragraph (if any) that immediately follows menu, add 1em top spacing between the two in IE*/ 
    padding-top: 1em; 
} 

/* Holly Hack for IE \*/ 
* html .horizontalcssmenu ul li { float: left; height: 1%; } 
* html .horizontalcssmenu ul li a { height: 1%; } 
/* End */ 

當用戶移動到指定頁面,按鈕的顏色應該改變和保持不變,只要他在該頁面。我怎樣才能做到這一點?

回答

1

有你想要什麼achieve.You

之後應該使用一些PHP在和樣式按鈕,檢查你的頁面沒有CSS選擇器鏈路狀態