2014-03-07 90 views
0

我有<input type = "button" id = "enterButton"/>并用下面的代码装饰它。但是图像周围出现灰色方块。无论如何删除它?如何删除按钮周围的框?

#enterButton{ 
    width: 45px; 
    min-width: 45px; 
    min-height: 45px; 
    margin-left: 3%; 
    background-image: url("../img/logo3.png"); 
    background-repeat: no-repeat; 
    border: none; 
    -webkit-background-size: 100%; 
    -o-background-size: 100%; 
    -moz-background-size: 100%; 
    -ms-background-size: 100%; 
    -khtml-background-size: 100%; 
    background-size: 100% 
} 

回答

0

你只需要改变背景颜色设置:

background-color:white; 

或红或蓝或透明..你需要什么是。

DEMO

+0

大概不会令整个广场面积在用户点击响应?此外,如果我使用脚本悬停装饰整个(现在看不见的区域)会触发它,对吧? –

+0

想要这样http://jsfiddle.net/9U4EZ/1/? – JackalopeZero

+0

谢谢,先生。 –

2

您可以添加:

background: transparent; 

或者你想使用的任何颜色。

+0

这不会让整个广场区域响应用户点击吗?此外,如果我使用脚本悬停装饰整个(现在看不见的区域)会触发它,对吧? –

0

尝试添加:

background-color: transparent; 

你的CSS。

0

如果添加background-color: transparent;这个问题将得到解决

#enterButton{ 
width: 45px; 
min-width: 45px; 
min-height: 45px; 
margin-left: 3%; 
background-image: url("../img/logo3.png"); 
background-repeat: no-repeat; 
border: none; 
-webkit-background-size: 100%; 
-o-background-size: 100%; 
-moz-background-size: 100%; 
-ms-background-size: 100%; 
-khtml-background-size: 100%; 
background-size: 100%; 
background-color: transparent; /* ADD THIS */ 
} 

为了使按钮悬停在CSS中添加此

#enterButton:hover { 
background-color: #ff0000; 
}