gpt4 book ai didi

css - 如何保留 CSS 按钮颜色

转载 作者:行者123 更新时间:2023-11-28 15:55:45 24 4
gpt4 key购买 nike

我的 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 */

当用户移动到指定页面时,按钮颜色应该改变,只要他在该页面中就保持不变。我该怎么做?

最佳答案

您可以简单地标记您的 <body>带有 id 的标签s,然后从那里制作 CSS 选择器。示例:http://css-tricks.com/id-your-body-for-greater-css-control-and-specificity/

关于css - 如何保留 CSS 按钮颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6164353/

24 4 0
文章推荐: css - 是否可以使用 css 来控制另一个 css 元素?
文章推荐: html - CSS 样式表不起作用的问题
文章推荐: javascript - 将