www.webdeveloper.com
Results 1 to 3 of 3

Thread: image in a button

  1. #1
    Join Date
    Jan 2003
    Location
    Thiruvananthapuram, Kerala, India
    Posts
    27

    image in a button

    how to set an image on a button so that it will work both in IE as well as Netscape?

    thanking you,

  2. #2
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    This works in IE6, NN4, NN7 and Opera 7, and almost certainly others -- that's just what I checked in...

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

  3. #3
    Join Date
    Nov 2002
    Posts
    984
    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>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles