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>
相关推荐
FRing036 小时前
vue2干货总结12(loading效果、全局前置导航守卫、搜索历史管理)
开发语言·前端·javascript·vue.js·vue2
YIAN6 小时前
我踩完 DeepAgents 记忆模块的坑,才搞懂长期记忆和摘要不是一回事
前端·javascript·agent
YIAN7 小时前
用 Deep Agents 复现一个深度调研助手:从主 Agent、子 Agent 到 Skill
javascript·agent
map_3d_vis8 小时前
百度地图 JSAPI 4.0 是什么:版本说明与能力概览
前端·javascript·webgl·地图·百度地图
码云之上8 小时前
微信小程序设备指纹实践,删了重装还能认出这台手机吗?
前端·安全·微信小程序
JavaGuide8 小时前
刚刚,GLM-5.4 正式发布,实测来了:看图用 Blender 建凉亭、做技术视频,再画一辆真能传动的自行车
前端·后端
乌鲁木齐德润恒圣信息科技有限公司11 小时前
GEO生成式引擎优化:技术原理与43引擎自动测试系统
大数据·前端·人工智能
泯泷11 小时前
第一章:Lit简介 - 现代Web组件标准
前端·javascript·web components
Moment12 小时前
AI 写代码越来越快,程序员为什么反而更累了
前端·后端·面试
apeman12 小时前
git-cherry合并代码工具
前端·后端