1 reply [Last post]
kiwis
kiwis's picture
Offline
Enthusiast
Last seen: 1 year 44 weeks ago
Timezone: GMT+12
Joined: 2009-03-07
Posts: 68
Points: 108

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: 2 years 4 weeks 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.