Change the Background Color with onMouseover (HTML)

vegaseat vegaseat is offline Offline Feb 5th, 2005, 3:38 am |
0
Use onMouseover to change the background color of your webpage. Can be applied to change other things like images and so on.
Quick reply to this message  
HTML and CSS Syntax
  1. <!-- Experiments with the mouse vegaseat 6/15/02 -->
  2. <!-- onMouseover, href, bgcolor -->
  3.  
  4. <html>
  5. <head>
  6.  
  7. <title>change the background color with onMouseover</title>
  8.  
  9. </head>
  10. <body>
  11.  
  12. Move the cursor to the color you want ...
  13. <br>
  14. <br>
  15. <a href="" onMouseover="document.bgColor='red'">Red</a>
  16. <br>
  17. <a href="" onMouseover="document.bgColor='orange'">Orange</a>
  18. <br>
  19. <a href="" onMouseover="document.bgColor='yellow'">Yellow</a>
  20. <br>
  21. <a href="" onMouseover="document.bgColor='green'">Green</a>
  22. <br>
  23. <a href="" onMouseover="document.bgColor='magenta'">Magenta</a>
  24. <br>
  25. <a href="" onMouseover="document.bgColor='purple'">Purple</a>
  26. <br>
  27.  
  28. </body>
  29. </html>
0
parthireach parthireach is offline Offline | Sep 14th, 2006
:rolleyes: hai
 
0
prathapvs prathapvs is offline Offline | Oct 15th, 2006
i think its not working
 
0
anilexi anilexi is offline Offline | Mar 30th, 2007
Boring 100% Nothing Work It. Like U
 
0
remotions remotions is offline Offline | Jun 9th, 2007
It works, just you need to fill the href="" with # so that it looks like this: href="#". Or you will have mouse click to point your browser to the start page of your site. Also you have to disable CSS background styles for particular page.
 
0
lizzeelike lizzeelike is offline Offline | Aug 14th, 2008
is it possible to do this same work using outside"CSS" file?plz do reply
thanks
lizzeelike
 
 

Message:


Thread Tools Search this Thread



Tag cloud for HTML and CSS
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC