layui表单必填项带*样式

分享 未结 1 491
观海听潮
观海听潮 2019-9-11
悬赏:20飞吻
.layui-form-label.layui-required:after{
content:"*";
color:red;
position: absolute;
top:5px;
left:15px;
}
<div class="layui-form">
<div class="layui-form-item">
<label class="layui-form-label layui-required">消息标题:</label>
<div class="layui-input-block">
<input type="text" name="name" autocomplete="off" placeholder="请输入消息标题" class="layui-input">
</div>
</div>
</div>

示例:
回帖