我目前正在向测试站点添加导航栏。<a>
我已经看到一些导航栏通过在标签下方添加一个栏或发光来指示当前选定的页面。我现在很困惑以正确的方式实现这种 css 风格。如何在选定对象周围实现发光效果,<a>
以便用户现在可以访问他们当前所在的页面? 例子
谢谢
对于我的<a>
标签,我创建了一个.buttonNav
类
导航栏的CSS相关规则:
<style>
/************** Header Styling ****************/
#navigation {
left: 440px;
margin-top: 80px;
position: relative;
}
#contentNav { color: #cfdae3; }
/* Dark Button CSS */
.buttonNav {
outline: 0;
padding: 5px 12px;
display: block;
color: #EBEBEB;
font-weight: bold;
text-shadow: 1px 1px #1f272b;
border: 1px solid #1c252b;
border-radius: 3px;
background: #232B30;
}
.buttonNav:hover {
color: #fff;
background: #4C5A64;
}
.buttonNav:active {
background-position: 0 top;
position: relative;
top: 1px;
color: #fff;
padding: 6px 12px 4px;
background: #20282D;
box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* CSS3 */
}
.button-list {
list-style: none outside none;
overflow: hidden;
}
.button-list li { float: left; margin: 0 5px 0 0; }
.button-list li.search { padding-left: 18px; margin-left: 10px; position: relative; list-style: none outside none;}
</style>
HTML
<div id="header">
<div class="search"><input type="text" class="search-input" name="search" value="Search" onclick="$(this).val('');" /><input type="submit" class="search-submit" /></div>
<div id="navigation">
<ul class="button-list">
<h2>MAIN TITLE PAGE</h2>
<li><a href="http://webprolearner2346.zxq.net/css-test2/index.php" class="buttonNav" >Content 1</a></li>
<li><a href="http://webprolearner2346.zxq.net/css-test2/content2.php" class="buttonNav" >Content 2</a></li>
</ul>
</div>
</div>