css - 根据 Bootstrap 4 中的移动设备更改文本对齐方式

标签 css bootstrap-4

我有一个水平标签和文本字段。当我在小型设备上显示时,它显示如下图..

enter image description here

我想在小型设备中左对齐显示名字。我使用了下面的代码

 <div class="row">
    <div class="col-sm-4 text-right">
        <label for="firstname" class="control-label text-right">First Name :</label>
     </div>
      <div class="col-sm-6">
        <input type="text" class="form-control" placeholder="Enter Your First Name"  />                 
      </div>

请帮助我..

最佳答案

仅使用 Bootstrap


<div class="row">
    <div class="col-sm-4 text-md-right text-sm-left" >
        <label for="firstname" class="control-label">First Name :</label>
     </div>
      <div class="col-sm-6">
        <input type="text" class="form-control" placeholder="Enter Your First Name"  />                 
      </div>

关于css - 根据 Bootstrap 4 中的移动设备更改文本对齐方式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56024478/

相关文章:

容器 div 上的 CSS 框阴影导致滚动条

css - 带有@font-face 的Helvetica Neue Light ..合法吗?

html - 从嵌入内容中删除不需要的边距/填充

html - 停止 Bootstrap 表格拉伸(stretch)到全屏宽度并向单元格添加额外空间

html - 如何在 Bootstrap 中使用网格系统对齐 Bootstrap 输入和标签?

css - Bootstrap 4 截断文本显示至少两行

JavaScript Sprite 表用于普通和视网膜屏幕

css - 理解一些第 n 个 child 的例子

JavaScript 代码不适用于 BootStrap 4,因为它没有隐藏类,

bootstrap-4 - 为什么 Bootstrap 4 Beta .invalid-feedback 在字段有效时显示?