[問題] 針對不同瀏覽器,文字欄位長度不一樣,以及置中問題

看板Web_Design作者 (我的生命因你而發光)時間15年前 (2009/05/24 22:18), 編輯推噓5(503)
留言8則, 6人參與, 最新討論串1/1
大家好,我使用IE6與Firefox 3.0觀看以下的網頁,為何不一樣呢? 1.用不同瀏覽器看起來不一樣長,要怎樣更改才能使得文字欄位一樣長呢? 2.用不同瀏覽器看,Firefox沒有置中,而IE6有,這是怎樣問題呢? 該怎樣改? 我看很多別人網頁都不會有這些問題,不知道該怎樣解決呢?謝謝~ PS:我是使用Dreamweaver製作的,以下是程式碼部分: <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>測試欄位長度 &amp; 置中問題</title> <style type="text/css"> body { background: #FFFFFF url(images/bg.gif) left top repeat-x; background-color: #72CDE4; } #inquiry{ width:500px; height:500px: } #inquiry table{ width:100%; border:1px solid #CCCCCC; text-align:center; background-color: #FFFFFF; } #inquiry th{ padding:5px 15px 5px 15px; } #title { background: #FFFFFF url(images/loginbg.jpg) left top repeat-x; } #title h3{ padding: 10px 0 10px 0; } #loginform{ border:none; } #loginform table{ width:300x; margin:20px 0 20px 0; } body img{ padding:20px 0 20px 0; } </style> </head> <body> <form action="/" method="post" id="inquiry"> <table border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td> <div id="title"> <h3> 測試後台</h3> </div> <div id="loginform"> <table border="0" summary="店家登入的填寫欄位"> <tr> <th scope="row"><label for="id">帳號:</label></th> <td><input type="text" name="id" size="30" id="id"/></td> </tr> <tr> <th scope="row"><label for="password">密碼:</label></th> <td><input type="password" name="password" size="30" id="password" /></td> </tr> <tr> <th></th> <td> <input type="submit" name="button" id="button" value="登入" /> </td> </tr> </table> </div> </td> </tr> </table> <div align="center"></div> </form> </body> -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 123.193.218.254

05/24 22:22, , 1F
我用過CSS的width,但是還是不一樣...
05/24 22:22, 1F

05/24 23:07, , 2F
你input都沒有被css設定到寬度呀
05/24 23:07, 2F

05/24 23:26, , 3F
每個文字欄位都設定相同的font-family試試看
05/24 23:26, 3F

05/25 09:10, , 4F
2樓正解
05/25 09:10, 4F

06/05 00:06, , 5F
首先,每個BROWSER其實有不同的預設CSS,你可以先用Y!的
06/05 00:06, 5F

06/05 00:07, , 6F
reset-css把預設拿掉,再來設定你想要的CSS,但有時候
06/05 00:07, 6F

06/05 00:07, , 7F
需要用到CSS hack,因為IE的box model實作有誤
06/05 00:07, 7F

09/15 00:48, , 8F
要不要轉CodeJob?
09/15 00:48, 8F
文章代碼(AID): #1A6LTI6y (Web_Design)