|
Answer» could u please suggest how can make the color of the change just by putting the mouse over it(without CLICKING it) use the css property 'onmouseover' Try this out: Code: [Select]<div onmouseover="this.style.background='red'; this.style.color='blue'" onmouseout="this.style.background='black'; this.style.color='yellow'">Hello</div> Maybe I'm overly tired, but that code doesn't make much sense to me.
Wouldn't something like...
a:hover {color: INSERT COLOR HERE}
...be a bit simpler?ya it would be much simpler. I hadn't thought of the hover property. Although it is probably a bit limited, DEPENDING on what the application is. The method I posted would allow something with a green background to be changed to red on mouse over and then to black on mouse out. Hover would just change it back to the original color or style. And of course, you probably wouldn't want it all inline, it's just shorter and easier than creating a whole script to do it. Quote from: CBMatt on July 17, 2007, 11:29:33 AM Wouldn't something like...
<STYLE TYPE="text/css">a:hover {color: INSERT COLOR HERE}</STYLE>
...be a bit simpler?
Well, it would be simpler if he's using CSS. But, I doubt he is and I suspect he may not be familiar with CSS. Therefore, michaewlewis suggestion may be the simpler approach in this case.Different strokes for different folks, I guess. Either way, I hope sohini benefits from one of the codes...if he/she ever returns.
|