2017-05-27 35 views
-3

任何人都可以請給我一個固定px大小的例子,它有什麼用處。我需要一個固定的px大小的示例,並使框的大小不同

,也可以ü請幫我包裝div元素中的輸入和標籤,使盒子大小不同

  <label for="Year">Year :</label> 
      <input type="text" id="Year" name="year" placeholder="(YYYY)"> 

      <label for="LicencePlate">Licence Plate:</label> 
      <input type="text" id="LicencePlate" name="licencePlate" placeholder="LicencePlate"> 

      <label for="DateBooked">Date Booked:</label> 
      <input type="text" id="DateBooked" name="dateBooked" placeholder="24/10/2017"> 

      <label for="TimeBooked">Time Booked:</label> 
      <input type="text" id="TimeBooked" name="timeBooked" placeholder="14:00"> 

回答

0

#container .subcontainer .label{ 
 
    display:inline-block; 
 
    width:100px 
 
} 
 
#container .subcontainer .input{ 
 
    display:inline-block; 
 
    width:200px; 
 
} 
 
#container .subcontainer{ 
 
    padding:5px; 
 
}
  <div id='container'> 
 
       <div class='subcontainer'> 
 
       <div class='label'><label for="Year">Year :</label></div> 
 
       <div class='input'><input type="text" id="Year" name="year" placeholder="(YYYY)"></div> 
 
       </div> 
 
       
 
       <div class='subcontainer'> 
 
       <div class='label'><label for="LicencePlate">Licence Plate:</label></div> 
 
       <div class='input'><input type="text" id="LicencePlate" name="licencePlate" placeholder="LicencePlate"></div> 
 
       </div> 
 
       
 
       <div class='subcontainer'> 
 
       <div class='label'><label for="DateBooked">Date Booked:</label> 
 
      </div> 
 
       <div class='input'><input type="text" id="DateBooked" name="dateBooked" placeholder="24/10/2017"></div> 
 
       </div> 
 
       
 
       <div class='subcontainer'> 
 
       <div class='label'><label for="Year">Year :</label></div> 
 
       <div class='input'><input type="text" id="Year" name="year" placeholder="(YYYY)"></div> 
 
       </div> 
 
       
 
       <div class='subcontainer'> 
 
       <div class='label'><label for="TimeBooked">Time Booked:</label> 
 
      </div> 
 
       <div class='input'><input type="text" id="TimeBooked" name="timeBooked" placeholder="14:00"></div> 
 
       </div> 
 
      </div>

我希望上面的代碼會幫助你。

0

任何人都可以請給我固定的像素大小的一個例子

這裏是一個描述大小的盒子。

element { 
    width: 20px; 
    height: 20px; 
    background: red; 
} 

,什麼是它的使用。

告訴瀏覽器如何顯示元素

,也可以ü請幫我包裝div元素中的輸入和標籤,使盒子大小不同

的應該如何標記和輸入字段樣式列表的示例

https://jsfiddle.net/sheriffderek/at2m1r6v/