How to implement Hover buttons?

1. Create a stylesheet

a #login {
  background: url(../skin/images/login_button.gif) no-repeat left top transparent;
  width: 53px;
  height: 24px;
  border: 0px;
}
 
a:hover #login {
  background-image: url(../skin/images/login_button_hover.gif);
}

2. Call the css in JSP

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../path/stylesButton.css" type="text/css" rel="stylesheet">
</head>

3. Concerned Button – Login in this case

<a href="#">
<input type="image" id="login" src="../path/spacer.gif" align="left"alt="Login">
</a>


spacer.gif should be transparent.

Advertisements