Jump to content

make the value of a submit button invisible


x_maras

Recommended Posts

Hi,

 

I want to make a submit button which will have an image as

a background.

This button needs to have a value, but I dont want this value to appear

in the page.

 

I know the <input type="image"> but I would like another solution

with css beacause I don't want to manage the button with javascript.

 

 

I tried the following css in these browsers: mozilla 3 / google chrome 2.0 / opera 9 / safari 4 / ie 7

 


/*does n't work with ie and opera tested in: mozilla, opera, chrome, safari, ie )*/
input.test {
background-image:url('webserver.png'); 
width: 64px; 
height: 64px; 
color:transparent;
border: 0px solid #FFFFFF;
}

/*Doesn't work with ie only (tested in: mozilla, opera, chrome, safari, ie )*/
input.button{
background-image:url('webserver.png'); 
width: 64px; 
height: 64px; 
text-indent:-9999px;
border: 0px solid #FFFFFF;
}

/*does n't work with ie and opera tested in: mozilla, opera, chrome, safari, ie )*/
#name{
background-image:url('webserver.png'); 
width: 64px; 
height: 64px; 
color: transparent;
text-transform: capitalize;
border: 0px solid #FFFFFF;
}

/*Doesn't work with ie
    Actually this is the best solution, because works in all the other browsers 
    and in the ie doesn't show the text but it still shows a dot (a little bigger than a dot), 
    which is visible especialy if the background images color is light.
*/
input.submit {
background-image: url('webserver.png');
width: 64px;
height: 64px;
font-size: 0px;
border: 0px solid #FFFFFF;
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.