Remove border from buttons

I tried to create buttons and insert my own images instead of the standard button images. However, the gray frame from the standard buttons still remains, showing on the outside of my black button images.

Does anyone know how to remove this gray frame from a button, so this is just an image? Thank.

+81
html css button
Jul 16 '12 at 1:23
source share
7 answers

Add

padding: 0; border: none; background: none; 

to your buttons.

Demo:

https://jsfiddle.net/Vestride/dkr9b/

+143
Jul 16 '12 at 1:27
source share

It seems to work fine for me.

 button:focus { outline: none; } 
+28
Jan 04 '16 at 5:31
source share

I had the same problem, and even if I stylized my button in CSS, it would never pick up border:none , but what worked added the style directly to the input button like this:

 <div style="text-align:center;"> <input type="submit" class="SubmitButtonClass" style="border:none;" value="" /> </div> 
+6
May 04 '13 at 16:08
source share

Try using: border:0; or border:none;

+2
Jul 16 '12 at 1:27
source share

The usual trick is to make the image itself a part of the link instead of the button. Then you bind the click event to the custom handler.

Frames like jQuery-UI or Bootstrap do this out of the box. Using one of them, you can easily weaken the concept of the entire application.

+1
Jul 16 '12 at 1:30
source share

You can also try the buttons background:none;border:0px for the buttons.

also the css selector div#yes button{..} and div#no button{..} . hopes this helps

+1
Jul 16 2018-12-12T00:
source share
 $(".myButtonClass").attr("style","border:none; background-color:white; padding:0"); 

works great for my .xhtml pages.

-one
Mar 06 '19 at 19:40
source share



All Articles