CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 15th, 2004, 11:41 AM
versionsix versionsix is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 28 versionsix User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
help with mouseover bg color change

I know how to make the background of a link change but how do you do it if it isnt a link? in css...

Reply With Quote
  #2  
Old June 15th, 2004, 11:53 AM
Akh's Avatar
Akh Akh is offline
|<.+#f@#+.&.|
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2002
Location: norway
Posts: 2,715 Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 4 Weeks 17 h 42 m 44 sec
Reputation Power: 642
with the :hover property, you can use it on any element
it doesn't have to be a link

p:hover {
background:#eee;
}

this works in standard compliance browsers.

Reply With Quote
  #3  
Old June 15th, 2004, 12:00 PM
versionsix versionsix is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 28 versionsix User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks, one more thing..

What would you put in your <div> to make that p:hover show up? Thanks!

Reply With Quote
  #4  
Old June 15th, 2004, 12:11 PM
Akh's Avatar
Akh Akh is offline
|<.+#f@#+.&.|
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2002
Location: norway
Posts: 2,715 Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 4 Weeks 17 h 42 m 44 sec
Reputation Power: 642
the style i provied should work on any paragraph in the document.

<p> Some text </p>

and as i said this only work in standard compliance browsers, like mozilla,opera and khtml-browsers.
so you won't see the effect in msie.

Reply With Quote
  #5  
Old June 15th, 2004, 07:26 PM
loremipsum loremipsum is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: Bristol UK
Posts: 29 loremipsum User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 34 m 48 sec
Reputation Power: 0
bluffing

How about bullying ie into displaying the rollover by setting up a style for the unbutton and attaching it to a null link (scripting out the underline and change in cursor of course...)

so...
Code:

in the head:

<style type="text/css">
.unbutton {color:#666666;}

a.unbutton:link, a.unbutton:visited {
cursor:default; text-decoration:none;}

a.unbutton:hover {
background-color:#cccccc; cursor:default; text-decoration:none;}
</style>

in the body:

<a href="javascript:;" class="unbutton">
this isn't a link you know</a>



Alternatively you could use the javascript

Code:
onMouseOver="this.style.background='#cccccc'" 
onMouseOut="this.style.background='#ffffff'"


to alter the bg colour of your div

That any help?

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > help with mouseover bg color change


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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 On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT