Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 删除html输入周围的边框_Css_Cross Browser_Zurb Foundation - Fatal编程技术网

Css 删除html输入周围的边框

Css 删除html输入周围的边框,css,cross-browser,zurb-foundation,Css,Cross Browser,Zurb Foundation,我想为我的web应用程序创建搜索功能 以下是FF&IE的外观,没有奇怪的边框也可以 火狐 即 下面是Chrome&Safari的外观,它在输入元素周围有奇怪的边框 铬 狩猎 这是我的html和css代码 <input type="search" id="generic_search" onkeypress="return runScript(event)" /> <input type="button" id="generic_search_button" />

我想为我的web应用程序创建搜索功能

以下是FF&IE的外观,没有奇怪的边框也可以

火狐

下面是Chrome&Safari的外观,它在输入元素周围有奇怪的边框

狩猎

这是我的html和css代码

<input type="search" id="generic_search" onkeypress="return runScript(event)" />
<input type="button" id="generic_search_button" />
如何删除该边界

border-width:0px;
border:none;

我使用过这个,在大多数浏览器(Chrome、Safari、FF、IE等)中,它对我来说都很好使用这个我希望它对你有帮助。。。 边界:没有!重要的; 背景色:透明

试试这个

<div id="generic_search"><input type="search" onkeypress="return runScript(event)" /></div>
<button type="button" id="generic_search_button" /></button>

试试这个

#generic_search_button
{
    float: left;
    width: 24px; /*new width*/
    height: 24px; /*new width*/
    border: none !important; /* no border and override any inline styles*/
    margin-top: 7px;
    cursor: pointer;
    background-color: White;
    background-image: url(/Images/search.png);
    background-repeat: no-repeat;
    background-position: center center;
}

我认为图像大小可能有误

您的代码如下所示

试一试


border:0
应该足够了,但如果不够,可能按钮的浏览器默认样式会产生干扰。您是否尝试过将
外观设置为
(例如
-webkit外观:无

在我的例子中,我使用的CSS框架添加了
框影
,因此我还必须添加

box-shadow: none;
因此,完整的代码片段是:

border: none; 
border-width: 0; 
box-shadow: none;
很简单

input {border:0;outline:0;}
input:focus {outline:none!important;}

我有时使用这个css代码删除焦点输入边框。希望会帮助你-:

  input:focus, textarea:focus, select:focus{
    outline: none;
}

您是否尝试将
边框:无
直接应用于
#通用搜索
?您也可以尝试使用
边框颜色:透明
,以防万一,但如果显示边框,它仍会占用空间。
边框:0
应该足够了,但如果不足够,则可能会影响按钮的浏览器默认样式。您是否尝试过将
外观设置为
none
(例如
-webkit外观:none
)@MurraySmith
-webkit外观:none
工作正常!正确的。为了简洁起见,我省略了标准内容,但你是对的。为了清楚起见,我将更新答案。谢谢。基金会6是一个需要这个框架的例子。
input {border:0;outline:0;}
input:focus {outline:none!important;}
  input:focus, textarea:focus, select:focus{
    outline: none;
}