2013-07-07 35 views
0

我該怎麼做,所以如果我最小化瀏覽器窗口,表格的輸入會變小。謝謝!在HTML中自動調整輸入字段的大小

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> 
<title>Insert title here</title> 
</head> 
<body> 
    <table> 
     <tr> 
      <td> 
       <input type=text> 
      </td> 
      <td> 
       <input type=text> 
      </td> 
     </tr> 
      <td> 
       <input type=text> 
      </td> 
      <td> 
       <input type=text> 
      </td> 
     <tr> 
     </tr> 
    </table> 
</body> 
</html> 

回答

1

嘗試使用百分比在你的CSS來調整

<style> 
input[type="text"]{ 
    width:10%;/* Whatever percent you want*/ 
} 
</style> 
0
<style> 
    input 
    { 
    width:100%; 
    height: 100%; 
    } 
</style> 

還補充:

<table cellspacing="5px"> 

希望這有助於你