0

html:

<input type="image" />

css:

input[type="image"]
  {  border:0;
     border-color:transparent;
     background:transparent;
     width:150px;
     outline:none;
  }

i don't want to use src="img url", i want to use background:(url) i have added border:0 but still border is coming in chrome

JSFiddle > http://jsfiddle.net/akash4pj/PYKfr/1/

6 Answers6

2

Add an 1x1 GIF to the src attribute will solve the problem:

<input type="image" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" />

JSFiddle

You can find the answer from a similiar question here: chrome border issue

Community
  • 1
  • 1
Tony Dinh
  • 6,668
  • 5
  • 39
  • 58
  • this is working for me in Chrome 36. Problem for me was I was using an image input but setting the background image using css, so Chrome automatically put some square around the input... border and all that doesn't fix anything – xer21 Aug 23 '14 at 00:02
0

Use rather the following CSS property :

border:0px;

or

border:none;

If it doesn't work, check your parent tag, maybe your div or span container have a border set.

Alex
  • 4,599
  • 4
  • 22
  • 42
0

Try this:

input[type="image"]
{
    border:0;
    border-color:transparent;
    background:transparent;
    width:150px;
    outline:none;
    border-style: none;
}
Itay Grudev
  • 7,055
  • 4
  • 54
  • 86
nikitz
  • 1,051
  • 2
  • 12
  • 35
0

the border: none property should fix it:

input[type="image"]
{  
    border:none;
    border-color:transparent;
    background:transparent;
    width:150px;
    outline:none;
}
Max
  • 12,622
  • 16
  • 73
  • 101
Code
  • 438
  • 1
  • 5
  • 17
0

in you code { you are using 2 times. also you have to call image as CSS background property.

you can use like this.

input[type="image"]{
  border:0 none !important;
  outline:0 none !important;
  -webkit-border:0 none !important; 
  border-color:transparent;
  background:transparent;
  width:100px;
  height:25px;
  display: block;
  background: url("http://lorempixel.com/100/25")
}

here is the Working Demo. http://jsbin.com/kiherove/1/

Kheema Pandey
  • 9,977
  • 4
  • 25
  • 26
0

Sometimes in Chrome when you adjust the Zoom to greater or less than 100%, borders will appear on images. You may not have noticed that the Zoom got adjusted. Its a bit of a long shot, but if your CSS is correct, that may be what it is.

Garreth McDaid
  • 2,427
  • 22
  • 34