GIDForums  

Go Back   GIDForums > Webmaster Forums > Web Design Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 21-Oct-2007, 21:27
addi addi is offline
New Member
 
Join Date: Oct 2007
Posts: 1
addi is on a distinguished road

Need Help with hover in style.css


Hi All -

I need some help with presentation of style.css file. I would like the background- color to be a of a different value when a mouse is hovered on the footer urls on my page than the background-color that appears for urls on other sections of the page.

I have taken the snippet of the HTML code that shows the footer code, along with the screen shot of the footer section of the page.

HTML Code:
<div id="footer"> <div id="footerWrap"> <ul class="tameHoriz"> <li><a href="t-about.aspx">About YourCompany.com</a> |</li> <li><a href="t-returns.aspx">Returns</a> |</li> <li><a href="t-faq.aspx">FAQ</a> |</li> <li><a href="t-contact.aspx">Contact Us</a></li> </ul> <ul class="tameHoriz"> <li><a href="t-affiliate.aspx">Affiliates</a> |</li> <li><a href="giftregistry.aspx">Gift Registry</a> |</li> <li><a href="wishlist.aspx">Wishlist</a> |</li> <li><a href="sitemap2.aspx">Site Map</a> |</li> <li><a href="t-privacy.aspx">Privacy Policy</a> |</li> <li><a href="t-security.aspx">Security</a></li> </ul> <br /> <ul class="tame"> <li>&copy; YourCompany.com 2007. All Rights Reserved.</li> <li>Use of this website signifies your agreement to the <a href="http://localhost/newStore/t-privacy.aspx">Terms of Use</a> and <a href="http://localhost/newStore/t-privacy.aspx">Online Privacy Policy (updated 10-30-2007)</a>.</li> </ul> </div> </div>

The problem is that the page does not show the color I have specified in the style.css file for the "tame" and "tameHoriz" classes.

Additionally, the page is behaving differently between IE 6.1 and Firefox 2.0.0.8. I am not sure if any other css setting supersedes what I have specified below.

snippet of code from style.css
CSS Code:
ul.tame, ul.tame li
{
margin: 0;
padding: 0;
display: list-item;
list-style: none;
}

ul.tame li
{
line-height: 1.25em;
color: Gray;
}

a.tame:hover
{
color: Blue;
background-color: Yellow;
}

---
a.tameHoriz:Hover
{
background-color: Gray;
border-color: Lime;
}

.tameHoriz, ul.tameHoriz li
{
margin: 0;
padding: 0;
list-style: none;
font-size: 1em;
}
ul.tameHoriz li
{
display: inline;
font-size: 1em;
}
What am I doing wrong here? Many thanks in advance for any help I can get on this.
Attached Images
File Type: gif footer section.gif (11.5 KB, 31 views)
Last edited by cable_guy_67 : 24-Oct-2007 at 04:24. Reason: Added [HTML] and [CSS] tags
  #2  
Old 13-Jun-2008, 12:01
JustinFox JustinFox is offline
Junior Member
 
Join Date: Mar 2008
Posts: 59
JustinFox will become famous soon enough

Re: Need Help with hover in style.css


so, you want the div background to change colors when you hover of the link?

Code:
<a href ="http://www.somesite.com" onmouseover = "setBG()" onmouseout = "resetBG()">click here or hover</a> <script type = "text/javascript"> function setBG() { // myfooter being the id of your footer div. document.getElementById("myfooter").style.backgroundColor = "blue"; } function resetBG() { document.getElementById("myfooter").style.backgroundColor = "white"; } </script>

also you could change the css class reference of the element like so.

Code:
... function resetBG() { var element = document.getElementById("myfooter"); element.className = "original"; } ...

Justin Fox
 
 

Recent GIDBlogObservations of Iraq by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Having problem with hover buttons to function andyin Java Forum 0 09-Jul-2006 06:06
Free Hover Ads Generator? Anyone? zumbul Web Design Forum 1 01-May-2006 14:52

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 03:15.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.