Reputation: 6121
I use images as buttons, and have some CSS to make the background look and behave like a button. This works perfectly in all browsers normally, and on most of the pages I have. On this one button in Firefox only, half of the image is cut off.
http://jsfiddle.net/863ux696/ View this in Chrome and then Firefox to see what I mean.
<-Correct view, Chrome <- Incorrect view, Firefox
CSS:
.login-button {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
background-repeat: no-repeat;
background-size: 100%;
background-image: url(http://placehold.it/274x59);
width: 274px;
padding-left: 274px;
height: 59px;
}
HTML
<img class="login-button" />
Upvotes: 1
Views: 345
Reputation: 28239
Replace your <img>
tag with a <div>
one :
<div class="login-button"></div>
You are using an <img>
tag, but you are in fact not really displaying an image. I understand that you probably choosed this one because you have an image in the background.
Using <img class="login-button" />
is a bit heretic, as you do not have an src
attribute, and this is against the specification of <img>
tag
Upvotes: 1
Reputation: 78676
You can make the img as a a block
or inline-block
element.
.login-button {
display: inline-block;
}
Demo http://jsfiddle.net/863ux696/1/
Upvotes: 1