Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mouseover on li change background colour 1

Status
Not open for further replies.

litton1

Technical User
Apr 21, 2005
584
GB
I have 4 li tabs. When mouse over I would like the background to change colour to the same colour as the image. e.g. on this site, move over a tab and the image is replaced by a black background. I would like the black background to actually be the colour of the tab but I only seem to be able to have one colour as the background?


Age is a consequence of experience
 
Give your tabs a specific class so you can target their bg color.

HTML:
<ul>
			    <li style="background: url(img/navYellow.gif) no-repeat;">
<a href="[URL unfurl="true"]http://oakhowelettings.com"[/URL] [red][b]class="yellowtab"[/b][/red]>Home</a></li>
		   
  			    <li style="background: url(img/navOrange.gif) no-repeat;">
<a href="[URL unfurl="true"]http://oakhowelettings.com"[/URL] [red][b]class="orangetab"[/b][/red]>Home</a></li>

CSS:
#header li a[red][b].yellowtab[/b][/red]:hover { background-color: #f58221; color: #000; height: 20px; }  
#header li a[red][b].orangetab[/b][/red]:hover { background-color: #f58221; color: #000; height: 20px; }


----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
Thanks, that simple! This was the bit I could not get a.yellowtab:hover :). Works brilliantly!! Have a star

Age is a consequence of experience
 
Glad I could help.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top