layui form表单 调整 label 宽度

html 复制代码
这个可以调整所有label
.layui-form-label {
    width: 120px !important;
}
.layui-input-block {
    margin-left: 150px !important;
}

情况是这样的,表单里有多个输入框,只有个别label 是长的,我就想调整一下个别长的,其它不变

html 复制代码
<div class="layui-form-item">
    <label class="layui-form-label">
        是否分标分量:
    </label>
    <div class="layui-input-block">
        <input type="text" autocomplete="off" class="layui-input">
    </div>
</div>

class="layui-input-block" 改成 style="margin-left: 112px"

margin-left 是label 的宽度。

html 复制代码
.custom-label {
    float: left;
    white-space: nowrap; /*禁止换行*/
}

<div class="layui-col-md3">
    <div class="layui-form-item">
        <label class="layui-form-label custom-label">
            是否分标分量:
        </label>
        <div style="margin-left: 112px">
            <input type="text" autocomplete="off" class="layui-input">
        </div>
    </div>
</div>
相关推荐
2601_949868361 天前
Flutter for OpenHarmony 电子合同签署App实战 - 主入口实现
开发语言·javascript·flutter
m0_748229991 天前
Vue2 vs Vue3:核心差异全解析
前端·javascript·vue.js
C澒1 天前
前端监控系统的最佳实践
前端·安全·运维开发
xiaoxue..1 天前
React 手写实现的 KeepAlive 组件
前端·javascript·react.js·面试
摘星编程1 天前
在OpenHarmony上用React Native:自定义useHighlight关键词高亮
javascript·react native·react.js
hhy_smile1 天前
Class in Python
java·前端·python
小邓吖1 天前
自己做了一个工具网站
前端·分布式·后端·中间件·架构·golang
南风知我意9571 天前
【前端面试2】基础面试(杂项)
前端·面试·职场和发展
LJianK11 天前
BUG: Uncaught Error: [DecimalError] Invalid argument: .0
前端
2601_949613021 天前
flutter_for_openharmony家庭药箱管理app实战+用药知识详情实现
android·javascript·flutter