NewAge.Mike, on Aug 1 2006, 02:47 AM, said:
Well, Im trying to widen my view of HTML, and trying to stop relying on Flash to do all my effects.
http://newage.phpnet.us/test.php
I was able to get the image mouse overs in the header by myself
<img src="img1" onMouseOver="src='img2'" onMouseOut="src='img1'">
Well, I was doing some other pages and hoping I could use coding like that for table.
<table width="xxx" cellpadding="0" cellspacing="0" background="img1"
onMouseOver="background='img2'" onMouseOut="background='img1'" onClick="href='link'>
Well I was sceptical about the onClick fuction, but i thought the table mouse overs might work
well to my disadvantage they didnt. You guys know a better way to do it? cuz im stuck.
a good way to do it would be to use css....
lets say were using a normal link:
<a href="#">this is a normal link </a>
were going to make it have a box, a blue background and black text. dead easy in css:
a:link,
a:active,
a:visited{
border:1px solid #000;
background-color:#0000FF;
padding:3px;
color:#000000;
}
now when we mouse over (a:hover, a being <a> for a link, hover being the state of the link. so link, hover) we make a new bg color:
a:hover{
border:1px solid #000;
background-color:#FF00CC;
padding:3px;
color:#000000;
}
have a play, this css is very powerful (this was only basic) and you can do this with images aswell (background-image)
[full html]
<html>
<head>
<style>
<!--
a:link,
a:active,
a:visited{
border:1px solid #000;
background-color:#0000FF;
padding:3px;
color:#000000;
}
a:hover{
border:1px solid #000;
background-color:#FF00CC;
padding:3px;
color:#000000;
}
-->
</style>
<title>
</head>
<body>
<a href="#">this is a normal link
</body>
</html>
[edit]
its better then using tables and javascript, as javascript can be turned off in a users broswer.