Safari 文本框背景问题
我有一个文本框,我没有显示常规的 1px 带边框布局,而是尝试应用自定义弯曲图像作为背景。
由于某些原因,背景在桌面 Safari 和 iPad 移动 Safari 上未正确应用。它在 IE/FF 中运行良好。下面是代码;
<div class="inputBox"><input type="text" name="text1"></div>
#rightContent .inputBox{
background:transparent url(/images/dp/search_screen/keyback.gif) no-repeat scroll center 6px;
border:0pt none;
float:left;
height:40px;
#height:37px;
margin-left:10px;
width:450px;
overflow: hidden;
}
#rightContent .inputBox input{
padding:12px 8px 5px 12px;
width:446px;
margin: 0px;
border: 0px none;
background:transparent none no-repeat scroll center;
display: block;
/*outline: none;*/
height: 40px;
#height:37px;
#width: 430px;
#position: relative;
#left: 2px;
#padding:11px 0px 8px;
}
下面是IE/FF的截图
:
Safari:
I have a textbox and instead of showing the regular 1px bordered layout, I am trying to apply a custom curved image as background for that..
For some reasons, the background is not applied correctly on desktop Safari as well as iPad Mobile Safari..It works fine in IE/FF..Below is the code;
<div class="inputBox"><input type="text" name="text1"></div>
#rightContent .inputBox{
background:transparent url(/images/dp/search_screen/keyback.gif) no-repeat scroll center 6px;
border:0pt none;
float:left;
height:40px;
#height:37px;
margin-left:10px;
width:450px;
overflow: hidden;
}
#rightContent .inputBox input{
padding:12px 8px 5px 12px;
width:446px;
margin: 0px;
border: 0px none;
background:transparent none no-repeat scroll center;
display: block;
/*outline: none;*/
height: 40px;
#height:37px;
#width: 430px;
#position: relative;
#left: 2px;
#padding:11px 0px 8px;
}
Below are the screenshot
IE/FF:
Safari:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从包含图像的背景中删除“透明”。
如果这不起作用,则可能是有其他东西在控制 Safari 的文本框。您是否使用 CSS 重置?
编辑/
启用 Safari 中的开发者菜单。右键单击文本字段,然后单击“检查元素”。看看边界从哪里来。
或者要采取更快的路线,请在所有选择器的末尾添加
!important
。Remove the 'transparent' from your background that contains the image.
If that doesn't work, it looks like there's something else controlling Safari's text boxes. Are you using a CSS reset?
EDIT/
Enable the Developer menu in Safari. Right click on the text field and click Inspect Element. See where that border is coming from.
Or to take a quicker route, ad
!important
at the end of all your selectors.