Tuesday, April 5, 2011

CSS styled <li> mouseover that won't change on hover

I have a simple ul list. the li's contain simple a href's.

I have a background and all that on the li and I want to change the li's border when the a href is mouseover...

Is that possible?
<ul> <li><a href="#" class="admin_button">Button 1</a></li> </ul>

anyway, I need the li border to change on mouseover... this seems simple, but I can't figure it out.

From stackoverflow
  • I would make the li the same size as the a tag.

    then in your css file:

    ul li {
        border: 1px solid #000000;/*Black 1px border*/
    }
    
    ul li:hover {
        border: 2px dotted #ff0000; /*Red 2 pix dotted line border*/
    }
    

0 comments:

Post a Comment