css修正Input標簽在各種瀏覽器中差異,首先說明一下input、select等可能在各種瀏覽器中的表現差異:
1.當input或select與其他標簽(例如a、label)混排時,可能出現不居中的問題。
2.input里面輸入的文字行高存在差別,有空隙等等。
3....混排時,外層標簽不能控制表單標簽。
已解決的,看下面演示:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=GBK" /><title>Input標簽在各種瀏覽器中差異 - Liehuo.Net</title><style type="text/css">body {font-family:"宋體";font-size:12px;}table {border-collapse:collapse;border:solid red 1px;}td,th {border:solid red 1px;height:40px;}label {vertical-align:middle;}.inputtxt {width:200px;padding:0;font-family:"宋體";font-size:12px;height:15px;line-height:15px;vertical-align:middle;border:solid #0000FF 1px;}</style></head><body><form action="#" method="post"><table><tr><th width="44">firt</th><td ><input name="aj" type="text" maxlength="6" class="inputtxt" /><label>知</label><input type="text" maxlength="6" class="inputtxt" /></td></tr><tr><th>second</th><td><input name="bs" type="text" maxlength="6" class="inputtxt" /></td></tr></table></form></body></html> <br /><center>如不能顯示效果,請按Ctrl+F5刷新本頁,更多網頁代碼:<a href='http://www.vxbq.cn/' target='_blank'>http://www.vxbq.cn/</a></center>提示:可修改后代碼再運行!
上一篇 不要使用value作為li的自定義屬性
下一篇 IIS下asp上傳文件提示Request 對象錯誤的問題
程序員人生,我編程,我富裕,記住wfuyu網,php教程,php學習,php手冊,CMS模版制作
聲明:本站大部分內容是作者原創,少部分收集于互聯網供大家一起學習,原版權很多不明,如有侵權請聯系本站,謝謝!
粵ICP備14040726號-1?? 2015-2020 程序員人生 版權所有