我有几个按钮被样式化为选项菜单的标签。一切看起来都很好,而且它也正常工作。唯一的问题是活动按钮上的蓝色高亮显示。我该如何删除它?
由于我不理解的原因,我的代码片段没有复现出问题。function ShowCurrent()
{
document.getElementById('btnCurrent').className = "menu";
document.getElementById('btnFuture').className = "menu off";
}
function ShowFuture()
{
document.getElementById('btnFuture').className = "menu";
document.getElementById('btnCurrent').className = "menu off";
}
.menu
{
border: 2px solid grey;
border-bottom: none;
margin-bottom: -2px;
margin-right: 5px;
padding: 3px 2px;
position: relative;
z-index: 5;
}
.off
{
border-bottom: 2px solid grey;
padding: 2px;
}
.placeholder
{
border: 2px solid grey;
}
<div>
<button id="btnCurrent" class="menu" onClick="ShowCurrent();">Current</button>
<button id="btnFuture" class="menu off" onClick="ShowFuture();">Future</button>
</div>
<div class="placeholder">Just hanging out, taking up space</div>