Why has HTML Button with Background Image an UGLY rendering?

458 views Asked by At
<input type="button" value="Nice" />
<input type="button" value="Ugly"
style="background-image:url('https://i.stack.imgur.com/M8lk7.png');
background-repeat:no-repeat;
background-position:left center;
padding-left:150px;
height:160px" />

Have a look: https://jsfiddle.net/pbgmzp7j/

Is there a workaround?

3

There are 3 answers

1
AlexG On

Try it without the input and use button

<button>
    <img src="https://i.stack.imgur.com/M8lk7.png"/>
</button>

JSFiddle

1
Vicky On

try this

background-color:transparent;
border:none;

or you can use any color in bg. demo

1
pcs On

use:

css border:none; DEMO

<input type="button" value="Nice" />
<input type="button" value="Ugly" style="background-image:url('https://i.stack.imgur.com/M8lk7.png'); background-repeat:no-repeat; background-position:left center; padding-left:150px; height:160px; border:none;" />

UPDATE:

DEMO