Css 删除html输入周围的边框
我想为我的web应用程序创建搜索功能 以下是FF&IE的外观,没有奇怪的边框也可以 火狐 即 下面是Chrome&Safari的外观,它在输入元素周围有奇怪的边框 铬 狩猎 这是我的html和css代码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" />
<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;
}