我希望“标签”选项卡在鼠标悬停时具有与“搜索”选项卡相同的背景,我该怎么做?
我的搜索选项卡已经默认设置了背景,但是当我要点击“标签”时,我怎样才能让搜索上的背景显示在“标签”后面?
HTML:
<html>
<head>
<link href="arg.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="tab-item tab-selected" id="search-box">
Search
</div>
<div class="tab-item" id="tag-box">
Tags
</div>
</body>
</html>
CSS:
.tab-item {
-moz-border-radius: 10px;
border-radius: 10px;
font: 14px helvetica;
color: #000;
height: 20px;
float: left;
margin: 5px 5px 5px 5px;
padding: 5px 5px 5px 5px;
position: relative;
width: 75px;
}
.tab-mouseover {
background: #bdbdbd;
}
.tab-selected {
background: #c0c0c0;
}
最佳答案
关于html - 当鼠标经过所选选项卡时需要更改背景。如何?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7730897/