Trying to create a navigation bar for my new website, I want each button to change color when highlighted. Using <ul>
to make the navigation bar, is there a way to use "a:hover {background:#;}" as inline CSS on a specific element?
Attempted to assign ids to each <li>
or <a>
and reference them in an internal style sheet, but can't get it to work. Here's what I have so far:
#menu {height:37px;display:block;margin:20px auto;border:1px solid;border-radius:5px;margin-left:30px;max-width:550px}
#menu ul {margin:0;padding:0;}
#menu li {float:left;display:block;min-width:110px}
#menu a {display:block;padding:12px;font:bold 13px/100% Arial, Helvetica, sans-serif;text-align:center;text-decoration:none;text-shadow:2px 2px 0 rgba(0,0,0, 0.8); background-color:#5A8A41;border-right:1px solid #1b313d; color:#fff;}
#menu a:hover {background:#5D80B0;}
...
<div id='menu'>
<ul>
<li class='active'><a href='#'><span>Home</span></a></li>
<li><a href='#'>XML</a></li>
<li><a href='#'>SQL</a></li>
<li><a href='#'>Java</a></li>
<li><a href='#'>C#</a></li>
</ul>
</div>
New to html and CSS for just 1 week, please forgive any beginner mistakes. Thank you.