Image button displaying 'Submit query' ove

2020-03-24 03:08发布

问题:

My project is displaying correctly in both IE and chrome. However in FF for some reason the image button displays 'Submit query' over the top of it. I am setting the image location in CSS and it is definitely correct as it is working correctly in all browsers, its just that FireFox for some reason plasters 'Submit Query' over the top on each image button.

Here is my CSS:

.NavModuleTabs A.NavModuleSelectedWide1
{
color: #555555;
margin-top: 10px;
padding-top: 5px;
height: 25px;
background-image: url(../Images/NavBar/NavModuleTab_125.gif);
background-repeat: no-repeat;
font-weight: bold;
width: 130px;
display: block;
}

Does anybody have any ideas why this happens? I found a few solutions via google but nothing has worked for me so far.

Thank you

回答1:

Add this attribute to your button:

value=""


回答2:

Text-indent: -9999px; add this to your css



回答3:

also add css display:block and

Text-indent: -9999px;

Then it will work in all browsers



回答4:

still comes top in the google list so adding my 2 cents worth: the answers above work but don't address the cause; in our case it was the missing imageurl after replacing it with css like the above, in which case one simple solution is to use a linkbutton instead