Advertisement Jump to content
Sign in to follow this  
GotenRulezU

a little html help

This topic is 4547 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hey everyone i'm trying to make it so that when the mouse is hovered over a table cell my javascript will turn the background of the cell yellow. why isnt my code working and what should i do to make it work. keep in mine i iz a newb. <source> <html> <head> <title>Webpage</title> <style type="text/css"> td{ text-align: center; } .head{ background-color: gray; font-weight: bold; color: white; height: 20px; width: 150px; } .link{ background-color: black; color: white; height: 20px; width: 150px; } </style> </head> <body bgcolor="black" text="white"> <table border="5" color="gray"> <tr><td class="head">Hello</td></tr> <tr><td class="link" onMouseOver="this.style.bgcolor='yellow'">Cory</td></tr> </table> </body> </html> </source> oh btw spacing off cuz i'm doin it in notepad XD thx,

Share this post


Link to post
Share on other sites
Advertisement
There is no javascript invovled. It is completely CSS. Hope this helps.

Remove the "##" at

<##a href="default.htm">Cory
<##/a>
<##/div>

before you run the code.
-----------------------------------------------------

<html>
<head>
<title>Webpage</title>
<style type="text/css">
td{
text-align: center;
}
.head{
background-color: gray;
font-weight: bold;
color: white;
height: 20px;
width: 150px;
}
#link a{
background-color: black;
color: white;
height: 20px;
width: 150px;
}

#link a:hover
{
background-color:#FFFF66;
}
</style>
</head>
<body bgcolor="black" text="white">
<table border="5" color="gray">
<tr><td class="head">Hello</td></tr>
<tr>
<td>
<div id="link">
<##a href="default.htm">Cory
<##/a>
<##/div>
</td>
</tr>
</table>
</body>
</html>

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!