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;
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.