【问题标题】:How to make input time responsive using Bootstrap 4如何使用 Bootstrap 4 使输入时间响应
【发布时间】:2020-10-15 22:00:23
【问题描述】:

我正在做 laravel 项目,我需要让这个表单响应,我添加了这个<meta name="viewport" content="width=device-width, initial-scale=1.0"> 但没有任何改变 有什么建议 ? 谢谢你

这是表格:

  <section>
      <p>Gestion des horaires</p>
      <div class="row">
    <div class="col-4">
      <label>Lundi matin </label>
      <div class="row">
      <div class="col">
      <input type="time"  name="lun_mat1[]" /> 
      </div>
      <div class="col">
      <input type="time"  name="lun_mat1[]" />
      </div></div>
      </div>
      <div class="col-4">
      <label>Lundi après-midi </label>
      <div class="row">
      <div class="col">
      <input type="time"  name="lun_ap1[]" /> 
      </div>
      <div class="col">
      <input type="time"  name="lun_ap1[]" />
      </div>
      </div> </div>
      <div class="col-4">
      <input type="checkbox"  name="rememberMe"> Fermer
    </div>
    </div>
    </section>

【问题讨论】:

    标签: html css twitter-bootstrap bootstrap-4 responsive


    【解决方案1】:

    我认为您需要使用特定的 col 数字和断点来使您的代码具有响应性。将col-sm-4 col-12 添加到您的主要列中。这意味着这个块将是宽度的 4/12,直到 Small (576px) 引导宽度。然后它将我们 12/12 宽度。更多关于引导断点和cols 这里https://getbootstrap.com/docs/4.0/layout/grid/

    虽然已将class="form-control" 添加到您的inputs。现在他们也反应灵敏了

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/js/bootstrap.min.js"></script>
    
    
    <section class="container-fluid">
      <p>Gestion des horaires</p>
      <div class="row">
        <div class="col-sm-4 col-12">
          <label>Lundi matin </label>
          <div class="row">
            <div class="col">
              <input type="time" class="form-control" name="lun_mat1[]" />
            </div>
            <div class="col">
              <input type="time" class="form-control" name="lun_mat1[]" />
            </div>
          </div>
        </div>
        <div class="col-sm-4 col-12">
          <label>Lundi après-midi </label>
          <div class="row">
            <div class="col">
              <input type="time" class="form-control" name="lun_ap1[]" />
            </div>
            <div class="col">
              <input type="time" class="form-control" name="lun_ap1[]" />
            </div>
          </div>
        </div>
        <div class="col-sm-4 col-12">
          <input type="checkbox" name="rememberMe"> Fermer
        </div>
      </div>
    </section>

    【讨论】:

      猜你喜欢
      • 2020-02-20
      • 2018-02-25
      • 1970-01-01
      • 2021-07-07
      • 1970-01-01
      • 2018-06-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多