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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s