Currently, I am working on integrating a navigation bar into a test site. I have noticed that some navigation bars highlight the current selected page by adding a bar underneath or creating a glowing effect around the <a>
tag. I am unsure of the correct way to achieve this specific CSS styling. How can I implement a glow effect around a selected <a>
element so that users can easily identify the page they are currently on? EXAMPLE
Thank you
I have created a .buttonNav
class for my <a>
tags.
CSS rules related to the navigation bar:
<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 code:
<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>