Remove border from buttons

2019-01-17 05:26发布

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

Does anyone know how to remove this gray border from the button, so it's just the image itself? Thank you.

标签: html css button
6条回答
男人必须洒脱
2楼-- · 2019-01-17 05:44

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

also the css selectors are div#yes button{..} and div#no button{..} . hopes it helps

查看更多
时光不老,我们不散
3楼-- · 2019-01-17 05:49

Add

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

to your buttons.

Demo:

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

查看更多
叛逆
4楼-- · 2019-01-17 05:53

I was having the same problem and even though I was styling my button in CSS it would never pick up the border:none but what worked was adding a style directly on the input button like so:

<div style="text-align:center;">
    <input type="submit" class="SubmitButtonClass" style="border:none;" value="" />
</div>
查看更多
做自己的国王
5楼-- · 2019-01-17 06:02

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

查看更多
别忘想泡老子
6楼-- · 2019-01-17 06:03

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

Frameworks like Jquery-UI or Bootstrap does this out of the box. Using one of them may ease a lot the whole application conception by the way.

查看更多
趁早两清
7楼-- · 2019-01-17 06:04

This seems to work for me perfectly.

button:focus { outline: none; }
查看更多
登录 后发表回答