1 reply [Last post]
kiwis
kiwis's picture
Offline
Enthusiast
Last seen: 21 weeks 2 days ago
Timezone: GMT+13
Joined: 2009-03-07
Posts: 67
Points: 106

So I have an unordered list, with list items containing hyperlink tags

<ul>
 <li> 
  <a href="#">Tag</a>
 </li>
<ul>

On my LI tag, I have a border bottom set to the background color.

When my link is hovered I want to change the color of it?

How do I change the previous elements style?

ul li a:hover{
 text-decoration: none;
 color: #Blue;
}
 
ul li a:hover li{
 border-bottom: solid 5px #Green;
}

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 7 weeks 3 days ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9776
Points: 3858

Address the LI

li:hover {
    border-bottom: solid 5px green;
    }

g

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.