gpt4 book ai didi

html - 在 IE 中填充文本输入...可能吗?

转载 作者:技术小花猫 更新时间:2023-10-29 11:55:00 26 4
gpt4 key购买 nike

我有一个带有绝对定位搜索按钮的文本输入...为按钮腾出空间我使用了一些填充来防止文本进入按钮下方,这很好,它适用于 firefox,但不是浏览器。

事实上...在 IE 中似乎根本无法对文本输入进行填充。

他们有以下代码


<style type="text/css">
#mainPageSearch input {
width: 162px;
padding: 2px 20px 2px 2px;
margin: 0;
font-size: 12px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
background:#F3F3F3 url(form-shadow.png) repeat-x scroll left top;
border-color:#C6C6C6 #C6C6C6 #E3E3E3;
border-style:solid;
border-width:1px;
color:#666666;
}
#mainPageSearch {
margin-bottom: 10px;
position: relative; /* Lets me absolute position the button */
}
#mainPageSearchButton {
display: block;
position: absolute;
top:0px;
right: -2px;
text-indent: -2000em;
height: 22px;
width: 22px;
background: transparent url('images/searchBtn.png') top center no-repeat;
}
</style>


<form id="mainPageSearch" action="">
<input type="text"/>
<a id="mainPageSearchButton" href="#">Search</a>
</form>

我正在尝试做的事情是否可行,或者我应该接受它并处理搜索按钮下方的文本?

我知道我可以制作一个具有透明背景/边框的搜索框,并使用包含的 div 绘制样式...但这并不是一个真正的选择,因为我必须在地点。

也许我会为这个文本输入创建一个新类,使其透明并将普通文本输入样式分配给包含的 div?你怎么看?

编辑:抱歉,我应该包含文档类型...这里是:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

另外,我遇​​到的问题是在 IE 7 中

最佳答案

尝试使用行高

关于html - 在 IE 中填充文本输入...可能吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/607198/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com