abstract:使用class="layui-form" 来标识一个表单元素块,通过规范好的HTML结构、CSS类,以及内置的form模块来完成交互<!DOCTYPE html> <html> <head> <meta charset="utf-8"&n
使用class="layui-form" 来标识一个表单元素块,通过规范好的HTML结构、CSS类,以及内置的form模块来完成交互
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Layui后台管理系统</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" type="text/css" media="screen" href="../static/plugins/layui/css/layui.css" /> <script type="text/javascript" src="../static/plugins/layui/layui.js"></script> </head> <body style="background: #1e9fff"> <div style="width: 500px; margin: 270px auto 0;"> <div style="background: #fff; border-radius: 4px; box-shadow: 5px 5px 20px #444444; padding: 20px;"> <form class="layui-form"> <div class="layui-form-item" style="color: gray;"> <h2>后台管理系统</h2> </div> <hr> <div class="layui-form-item"> <label class="layui-form-label">用户名</label> <div class="layui-input-block"> <input type="text" name="title" required lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">密码</label> <div class="layui-input-block"> <input type="password" name="title" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">验证码</label> <div class="layui-input-inline"> <input type="text" class="layui-input"> </div> <img src="../yz.png"> </div> <div class="layui-form-item"> <div class="layui-input-block"> <button class="layui-btn" lay-submit lay-filter="formDemo">登录</button> </div> </div> </form> </div> </div> </body> </html>
Correcting teacher:灭绝师太Correction time:2019-01-07 17:21:38
Teacher's summary:layui比较容易上手,复制代码或者给相应的class,调用相应模块,主要是学会看文档,加油哟!