样式
- <style>
- /* 表单必填项,右红三角 */
- .fn_bixuan{position: relative;}
- .fn_bixuan::after{position: absolute;display: block;content: ''; z-index: 1;transform: rotate(-45deg); left: -10px;top: -10px;border: 10px solid; border-color: transparent transparent red;}
- </style>
html:在class中加fn_bixuan;不能加在表单元素本身上
- //文本框
- <div class="layui-input-block fn_bixuan">
- <input type="text" name="title" placeholder="标题" autocomplete="off" class="layui-input">
- </div>
-
- //下拉框
- <div class="layui-input-block fn_bixuan" >
- <select name="id">
- <option value="">请选择</option>
- </select>
- </div>