2011-11-23 65 views
0

代碼:如何正確安排字段名稱和字段本身?

#inputfield { 
width:300px; 
border: 2px solid #3f3f3f; 
height:30px; 
font-size:20px; 
padding-left:5px; 
color: #6f6f6f; 
} 
#inputname { 
margin-right:10px; 
font-size:20px; 
color: #3f3f3f; 
} 


<a id="inputname>Name:</a><input name="name" id="inputfield" type="text"> 
<a id="inputname>Other Name:</a><input name="other" id="inputfield" type="text"> 
<a id="inputname>Other Other Name:</a><input name="other_2" 
id="inputfield" type="text"> 

的名稱和領域看出來的地方。我試圖讓喜歡它看起來此頁面上的方式組織形式:

https://secure.hulu.com/signup 
+0

您不能有多個具有相同'id'的項目。你的意思是'class'。 – drdwilcox

回答

0

事情改變:

  1. 不要使用id。使用class.inputfield
  2. 確保設置displayinline-block使瀏覽器將信守width
  3. 你不想<a>標籤。你想要<label>標籤。
  4. 用自己的<div>包裝表單中的每一行,然後用它來設置行高和間距。