按钮边框&背景 [英] Button border & background

查看:79
本文介绍了按钮边框&背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的CSS我试图掩盖一个按钮的外观通过添加一个背景这样:

In my CSS I tried to mask a button's look by adding a background like this:

input[type=button]
{
background-image:url('../images/next-button.png');
background-position:0px;
background-repeat: no-repeat;
height:60px;
width:120px;
outline: 0;

}

input[type=button]:hover
{
background-position: 0px -66px;
}
input[type=button]:active
{
background-position: 0px -132px;
}

新背景出现,但背景上仍有一个灰色边框从按钮本身。如何删除这个?背景图片是一个透明的PNG,所以我知道这个大纲不是来自我使用的图片。

the new background shows up, but there is still a gray border around the background from the button itself. how do i remove this? The background image is a transarent PNG so I know this outline isn't from the image I'm using.

这里是按钮的HTML

here is the HTML for the button

<input type="button" id="submit1" />

感谢一堆!

-EDIT -

!--EDIT--

这是正确的方法!感谢答案的家伙!
CSS:

This is the proper way to do it! thanks for the answers guys! CSS:

input[type=button]
{
border: none ;
background-image:url('../images/next-button.png');
background-position:0px;
background-repeat: no-repeat;
height:60px;
width:120px;
outline: 0;

}

input[type=button]:hover
{
background-position: 0px -66px;
}
input[type=button]:active
{
background-position: 0px -132px;
}

.next_btn{
border: none ;
color:#FFFFFF;
background-color:#FFFFFF;
}

和HTML:

<input type="button" class="next_btn" id="submit1"/>


推荐答案

尝试添加

border: none

属性为输入[type = button]。

as an attribute for input[type=button].

这篇关于按钮边框&amp;背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆