Results 1 to 2 of 2

Thread: change hover on last list item

  1. #1
    Join Date
    Oct 2008
    Posts
    22
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default change hover on last list item

    Hi there,

    I use css to do my rollover effects on my website.

    I have a list and set the background images in the css to show active and hover states.

    Am I able to set a different hover state (different image on hover) for the last item in the list?

    Any help would be great.



    Code:
    <ul id="help">
       <li><a href="#">Get a quote online</a></li>
       <li><a href="#">Get a quote online</a></li>
       <li><a href="#" class="helplastitem">Get a quote online</a></li>
    </ul>
    Code:
    ul#help li
    {
    	position: relative;
    	height: 74px;
    }
    ul#help li a
    {
    	position: absolute;
    	width: 269px;
    	height: 74px;
    	padding:0 0 0 30px;
    	background: url(../images/need-help-bg.png) no-repeat top left;
    	text-decoration: none;
    }
    #what-next .helplastitem
    {
    	width:269px;
    	height:74px;
    	background:url(../images/help-last.png) no-repeat top left;
    }
    #support-help .bottomcurvehelp
    {
    	width:260px;
    	height:4px;
    	margin-left:9px;
    	background:url(../images/help-bottom-curve.png) no-repeat top left;
    }
    ul#help li a:hover
    {
    	background: url(../images/need-help-bg.png) no-repeat bottom left;
    }

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    li:list-child a:hover

    Usage:
    Code:
    <style type="text/css">
    span:last-child {
    color: green;
    }
    </style>
    <span>HI</span>
    <span>HI</span>
    <span>HI</span>
    Jeremy | jfein.net

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •