我與置於其上的搜索布頓絕對文本輸入...使空間我使用了一些填充,以保持文本從按鈕,這是很好的去下按鈕,它工作在Firefox,但不是IE 。在IE中填充文本輸入...可能嗎?
其實......這似乎是對文本輸入填充不能在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?你怎麼看?
編輯:對不起,我應該已經包括了doctype ...這裏是:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
也是,我有這個問題在IE 7
我終於遇到了這種可能性,但是,您的答案肯定值得讚揚:) – Jiaaro 2009-12-16 14:03:27
嗯....這似乎工作非常好跨瀏覽器,是迄今爲止我見過的最好的解決方案。但是,它確實使得Chrome和IE中的光標大小不同(略微偏離中心或更高),這是輕度惱人的。 – 2010-08-21 18:57:12