【问题标题】:i need an example of fixed px size and making the box different sizes我需要一个固定 px 大小的示例并使盒子大小不同
【发布时间】:2017-05-27 01:14:49
【问题描述】:

谁能给我一个固定像素大小的例子以及它的用途。

你也可以帮我将这些输入和标签包装在一个 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">

【问题讨论】:

    标签: html css input label


    【解决方案1】:

    #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>

    希望以上代码对你有所帮助。

    【讨论】:

      【解决方案2】:

      谁能给我一个固定像素大小的例子

      这是一个有描述尺寸的盒子。

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

      还有它的用途。

      告诉浏览器如何显示元素

      你也可以帮我把这些输入和标签包装在一个 div 元素中,并使盒子大小不同

      如何标记和样式化输入字段列表的示例

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

      【讨论】:

        猜你喜欢
        • 2023-01-09
        • 2015-02-05
        • 1970-01-01
        • 1970-01-01
        • 2020-04-15
        • 1970-01-01
        • 2017-07-04
        • 2019-08-04
        • 1970-01-01
        相关资源
        最近更新 更多