onmouseover question

liunx

Guest
I'm using onmouseover event to change the background colour of a cell in a table. There is also a word centered in the cell which is being used as a link (using <a href>).<br />
<br />
How can I make the whole cell an active link, rather than just the word placed in the center?<!--content-->Whats the code for just the ommouseover background for the cell?<br />
THANKS<!--content-->Hello,<br />
<br />
This is the code i used, it works, but I haven't checked if there's a better method!!<br />
<br />
<td width="25%" class="menu" <br />
onmouseover="this.style.backgroundColor='#0099cc'" <br />
onmouseout="this.style.backgroundColor='#c2a399'"><br />
<a href=http://www.htmlforums.com/archive/index.php/"index.htm">home</a></td><br />
<br />
ps One of the colors is not web safe<!--content-->where do i put the HTML code?<!--content-->I thought you were going to help me for a second there...lol<br />
<br />
You need to make a table inside the <body> tags, heres a simple one<br />
<br />
<table><br />
<tr><br />
<td></td><br />
<td></td><br />
</tr><br />
<tr><br />
<td></td><br />
<td></td><br />
</tr><br />
</table><br />
<br />
Then apply the code inside any of the opening <td> tags.<!--content-->i also thought he was gonna help you!:P <br />
add an onclick event handler in there, you'll still need the mouseover to see that it an active link :)<!--content-->Thanks Leoo,<br />
<br />
I tried this, but it deosn't work<br />
<br />
<td width="25%" class="menu" onmouseover=<br />
"this.style.backgroundColor='#0099cc'" onmouseout=<br />
"this.style.backgroundColor='#c2a399'"<br />
onClick="document.location.href='http://www.htmlforums.com/archive/index.php/about.htm';">about</td><br />
<br />
I would be grateful if you could tell me whats wrong!!<!--content-->Oops, it does work, what threw me was the cursor pointer not changing to a hand<!--content-->put 'cursor:pointer;' in your .menu style - should bring up the hand.<!--content-->Got a result now; THANKS<!--content-->oops, fotgot about the pointer seeing as it's not a normal link!, glad someone sorted it our for you though :D<!--content-->Originally posted by malecon <br />
ps One of the colors is not web safe <br />
<br />
I spent ages reading stuff about the web safe palette recently (last week I think). Is it still relevant? I got the clear impression - no. Quite an in depth article here <!-- m --><a class="postlink" href="http://hotwired.lycos.com/webmonkey/00/37/index2a.html?tw=design">http://hotwired.lycos.com/webmonkey/00/ ... ?tw=design</a><!-- m --><br />
<br />
Then, somewhere among the threads I found this tool, brilliant I thought. <!-- m --><a class="postlink" href="http://nebulus.org/index.html?pg=freebies/coders/palette/index.asp">http://nebulus.org/index.html?pg=freebi ... /index.asp</a><!-- m --><br />
<br />
Enthusiastic intermmediate here and I'd welcome brief thoughts on the web safe palette. :confused:<!--content-->Hey Bummy,<br />
<br />
I live in the same place, how you doing. One or two are rightly well strict on code and practice in here, so I do what i can can to tow the line, i know what you mean about colour tho.<br />
<br />
Great link for colour matching there; cheers. Drop me an email, if you want to chat some more <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e --><!--content-->And please stop calling me "Bummy". :( <br />
<br />
Aw jeeze m8, didn't glance at your locale when posting. How goes it m8? I'll be in touch my friend - tonite.<br />
<br />
Yeah, soon becomes obvious dunnit, many sticklers for legit code here, must admit tho I'm much the same myself. Am currently taking my first steps into xhtml.<br />
<br />
Web safe palette? Forget it, this is 2003 innit. All those outdated screen modes and the like, a very healthy percentage of all the articles I read said it was more or less ancient history now. Be in touch soon m8. ;)<!--content-->web safe colors was meant that in some browsers (early Netscape) would show colors really wierd. one color looked fine in IE and in NS it would be different. yes most of that has gone away but remember there are still quite a few people that still have old monitors and use old browsers. not as many as before but still quite a few.<!--content-->What about the difference between laptop and desktop? I ue a laptop to design, and i go to a desktop and find the colors look terrible - too luminous, other times too dull. I guess this is the difference between lcd and desktop. Any coping strategies out there?<!--content-->Yeah, I'd like to know that as well? I read a whole load of stuff about this and I really got the impression from what I understood to be several gurus, that web safe was a thing of the past. As scoutt says, I can appreciate older browsers okay but this is all about screen depth/resolution isn't it? Or is this just another of the webmasters turmoils? Why do a billion and one sites not adhere to web safe any longer then. I guess this is down to the individual designer, know your potential audience - right???<!--content-->that's an easy one, don't design on an lcd :)<br />
you could go about giving your lcd a color profile to try and match that of the crt<!--content-->Originally posted by noisearchitect <br />
I use a laptop to design, and i go to a desktop and find the colors look terrible - too luminous, other times too dull. I guess this is the difference between lcd and desktop. Any coping strategies out there? <br />
Do the colour selection with a CRT and layout and content with your laptop. I used my laptop just once and ran into the same thing. For now, I think that since most sites will be viewed through CRTs, I would work that way. I do like the way that LCD and plasma makes some shades glow (even grey, in it's own way!).<br />
I wonder what the stat's are for Monitor type popularity?<!--content-->the stats would certainly be interesting - surely with the advent of flat screens, and the drop in cost, the lcd is going to become the more popular option, in which case it would be better to choose the color scheme on the lcd. I have to admit (though probably just biased because I'm used to it) I much prefer the way colour looks on lcd. They look much deeper, and you're right about the glow.<br />
<br />
Anyone know of anywhere they have stats? Going to try the counter.com, w3schools uses that for browsers.<!--content-->and by what means do you expect to be able to detect lcd and crt screens?<!--content-->well you also have to factor in the users video card. we have come a long way in todays technology that video cards produce 32 million colors and more as it was back then you were lucky to get 16 colors let alone 256. so yes in a way it is a thing of the past but as I said there is still some old stuf out there.<br />
<br />
personally I wouldn't worry about. jsut code liek there is no tomorrow.<!--content-->Originally posted by scoutt <br />
personally I wouldn't worry about. jsut code liek there is no tomorrow. <br />
<br />
That's me sorted then, lord scoutt is correct - code like there's no tomorrow. ;) Guess I'll just leave these other folk to chat about this laptop thing. :P<!--content-->you're gonna give scoutt a big head with all this lord stuff :P<!--content-->lord scoutt :P just the other day I was sarcastic on everything I said, today I am a lord so does that make me a lord sarcastic scoutt?? LOL<!--content-->
 
Back
Top