Friday, September 12, 2008

How to change background color in a DIV tag on onmouseover

As a web developer it's essential that you are comfortable with CSS styles, you maybe a php,.net,ruby on rails developer but it's always good to have some style tricks in your pocket so that you don't need to find a web designer to do it for you. following code is a simple way to change the color of the background of a DIV tag on mouse over event.


<div onmouseover="this.style.background='green';"
onmouseout="this.style.background='white';">
kuppiya.com
</div>


Get Free Sinhala IT Learning Videos Kuppiya.com

Get custom programming done at GetAFreelancer.com!

4 comments:

  1. Awesome, I was looking all over for this code. I knew there was a simple way to do this. Thank you for posting this!

    ReplyDelete
  2. Thanks for your tip. Really useful

    ReplyDelete