How to use <mouseover> tag on a <td>. I wan to change <td> backgroundcolor...
How to use <mouseover> tag on a <td>. I wan to change <td> backgroundcolor...
post a url to the problematic site so we can help you troubleshoot
if your site is not published post the appropriate code wrapped in [code] tags
and read the Posting Policy
mouseover is not a tag.
onMouseover is an attribute, valid in some particular tags, such as <a>
I think that <td> will work with onMouseover, though I'm not sure that's valid (probably is, or some workaround).
Use is like this:
<tag onMouseover="javascripthere();">
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
You do not need JS for that. Simply use css with a link as block element in every table cell:
...that should work properly on every browser and it is valid HTML.Code:<html> <head> <style type="text/css"> table { border:none; } table a, table a:visited { display:block; width:100%; height:100%; background:#fff; color:#000; cursor:default; text-decoration:none; } table a:hover { background:#ccc; color:#fff; } </style> </head> <body> <table> <tr> <td><a href="#">text 1</a></td> </tr> <tr> <td><a href="#">bla bla bla bla<br /> bla bla bla bla bla bla</a></td> </tr> </table> </body> </html>
greetings
Max
Last edited by tech_support; 10-25-2007 at 06:54 AM.
#fff and #ccc aren't really valid. Use #FFFFFF and #CCCCCC.
Plus, that requires an a tag, which may or may not be used in this and also will not entirely fill every TD, unless it is standardized... then what's the point?
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
cannot use to change <td> background-image??
I try below idea... but don't work
Code:# Testing{ Background:URL(Image/helo.jpg); } <Table> <tr> <td id="Testing"> <a href="aaa.html">Helo</a> </td> </tr> </table>
or like this ?
<ul class="menu">Code:.menu li a:visited{ color: #aa2716; } .menu a:hover{ background-color: #F3F3F3; color: #aa2716; }
<li><a href="">link</a></li>
</ul>[/CODE]
since when?
there cannot be any space between the pound sign and the id
its also good to have a background color incase the image doesnt display due to the user having them disabled, or it being corrupt, or it being large so takes a while, etcetc.... you can usetransparent
to inherit the background color of the parent element.
Code:#Testing { background: #hexadecimal url('path/to/image'); }
I try this but when my ouse over no effect...
Code:#Testing table td:hover { background-image:url(Helo.png); } <Table> <tr> <td id="Testing"> <a href="aaa.html">Helo</a> </td> </tr> </table>
Bookmarks