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>
相关推荐
视频砖家15 分钟前
移动端Html5播放器按钮变小的问题解决方法
前端·javascript·viewport功能
lyj16899740 分钟前
vue-i18n+vscode+vue 多语言使用
前端·vue.js·vscode
小白变怪兽2 小时前
一、react18+项目初始化(vite)
前端·react.js
ai小鬼头2 小时前
AIStarter如何快速部署Stable Diffusion?**新手也能轻松上手的AI绘图
前端·后端·github
程序员柳2 小时前
基于微信小程序的校园二手交易平台、微信小程序校园二手商城源代码+数据库+使用说明,layui+微信小程序+Spring Boot
数据库·微信小程序·layui
墨菲安全3 小时前
NPM组件 betsson 等窃取主机敏感信息
前端·npm·node.js·软件供应链安全·主机信息窃取·npm组件投毒
GISer_Jing3 小时前
Monorepo+Pnpm+Turborepo
前端·javascript·ecmascript
天涯学馆3 小时前
前端开发也能用 WebAssembly?这些场景超实用!
前端·javascript·面试
我在北京coding4 小时前
TypeError: Cannot read properties of undefined (reading ‘queryComponents‘)
前端·javascript·vue.js