Jump to content
Sign in to follow this  
philipsmith

CSS - Hover Over 1 List Item

Recommended Posts

Hello, I am very new to CSS and HTML and have been learning since last week, so i hope someone can help me. I have a list, please see the HTML below, I want to make the list item 'Sparkling', sparkle when hovered over. I thought the CSS code below might make it sparkle, but that makes the entire list sparkle on hover - can anyone help me please?! Thank you! HTML<div class="container_12 clearfix"> <div id="header" class="grid_12"> <h1>Lacosta Wines</h1> <div id"nav"> <ul> <li><a href="index.html">Home</a></li> <li><a href="">Red</a></li> <li><a href="">White</a></li> <li><a id="sparkle" href="">Sparking</a></li> <li><a href="">Fine Wines</a></li> <li><a href="">Wine Tastings</a></li> </ul> </div> </div> CSSa:hover, #sparkle {background-image:url('http://www.addglitter.com/link-sparkle.gif');}

Share this post


Link to post
Share on other sites

You are actually using two selectors separated by a comma. The first selector targets ALL <a> elements in a hover state; the second targets the #sparkle element, but not in a hover state. Combine them like this: #sparkle:hover

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...