Click to See Complete Forum and Search --> : image in a button


saju_m
01-07-2003, 07:31 AM
how to set an image on a button so that it will work both in IE as well as Netscape?

thanking you,

pyro
01-07-2003, 08:40 AM
This works in IE6, NN4, NN7 and Opera 7, and almost certainly others -- that's just what I checked in...

<button type="submit" name="submit" value="submit"><img src="folder.gif" width=16 height=16 border=0 /></button>

Stefan
01-07-2003, 09:24 AM
Another alternative if you are not looking for a <button> (which belongs in a <form>) is to style link with CSS.

Notable though is that this method is NOT compatible with NS 4.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title></title>
<style type="text/css" title="Default" media="screen">

a {display:block; width:100px; background:url(yourimage.png); padding:0 10px; margin:5px; color:red; text-align:center;}

</style>
</head>
<body>

<p>
<a href="#">link</a>
<a href="#">link</a>
</p>

</body>
</html>