html - 如何连续移动两个输入框

标签 html css bootstrap-4

我设计了两个输入框,我想把它们一起移动,但是我的代码不起作用

这应该有一个简单的解决方案,但它们只是看起来像一个列表,而不是排成一行。

<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" />

<h2>ِStart Time</h2>
<div class="row">
  <div class="col">
    <label for="startTime">Hour(s) </label>
    <input type="number" class="form-control" id="startTime" min="0" max="23">
  </div>
  <div class="col">
    <label for="startTime">Minute(s) </label>
    <input type="number" class="form-control" id="startTime" min="0" max="59">
    <!--input type can be changed accordingly-->
  </div>
</div>

我哪里做错了?

最佳答案

我不知道你到底想要什么。它在现代浏览器中运行良好。 col 类可能有问题。有时我会在这门课上遇到一些烦人的事情。只需使用网格系统更改它们即可。这是下面的代码,

<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" />

<h2>ِStart Time</h2>
<div class="row">
  <div class="col-sm-6">
    <label for="startTime">Hour(s) </label>
    <input type="number" class="form-control" id="startTime" min="0" max="23">
  </div>
  <div class="col-sm-6">
    <label for="startTime">Minute(s) </label>
    <input type="number" class="form-control" id="endTime" min="0" max="59">
    <!--input type can be changed accordingly-->
  </div>
</div> 

我想你一定知道bootstrap的网格系统。 https://getbootstrap.com/docs/4.0/layout/grid/

关于html - 如何连续移动两个输入框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56617511/

相关文章:

html - 你如何用谷歌的CSS格式化下拉菜单?

css - 如何让 IE.css 覆盖 standard.css 的一部分?

php - 下拉菜单不显示在导航栏 Laravel 6.0 中

css - 无法更改 bootstrap 4 中 .custom-control-input 的焦点轮廓

html - Bootstrap 4 外部内容切换器大纲

javascript - 图像未加载或未出现在元素源中

html - 在一个选项卡中上传图片 = 我的网站无法在另一个选项卡中打开图片 - chrome

html - 为什么文字装饰: none not work inside p?

javascript - CSS 转换和时间安排似乎不对

html - 在 div 上应用灰度,但它的子元素之一除外