layui 的学习

时间:2021-10-05 16:16:01

1.  meta标签  https://www.cnblogs.com/wangyang108/p/5995379.html

  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

2. 引入样式  <link rel="stylesheet" href="css/layui.css">

        <script src="js/layui.js"></script>

    class 属性值

3. 基础

先引入  <form class="layui-form" action=""></from > div     放在from 标签内

 1.输入框 

<div class="layui-form-item">
<label class="layui-form-label">输入框</label>
<div class="layui-input-block">
<input type="text" name="" placeholder="请输入" autocomplete="off" class="layui-input">
</div>
</div>layui 的学习

  2.下拉框

<div class="layui-form-item">
<label class="layui-form-label">下拉选择框</label>
<div class="layui-input-block">
<select name="interest" lay-filter="aihao">
<option value="0">写作</option>
<option value="1">阅读</option>
</select>
</div>
</div>

  layui 的学习

  3.复选框

  

<div class="layui-form-item">
<label class="layui-form-label">复选框</label>
<div class="layui-input-block">
<input type="checkbox" name="like[write]" title="写作">
<input type="checkbox" name="like[read]" title="阅读">
</div>
</div>layui 的学习

  4.开关

<div class="layui-form-item">
<label class="layui-form-label">开关关</label>
<div class="layui-input-block">
<input type="checkbox" lay-skin="switch">
</div>
</div>

<div class="layui-form-item">
<label class="layui-form-label">开关开</label>
<div class="layui-input-block">
<input type="checkbox" checked lay-skin="switch">
</div>
</div>

  layui 的学习

  5.单选框

<div class="layui-form-item">
<label class="layui-form-label">单选框</label>
<div class="layui-input-block">
<input type="radio" name="sex" value="0" title="男">男
<input type="radio" name="sex" value="1" title="女" checked>女
</div>
</div>

layui 的学习

  6.输入文本域
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">请填写描述</label>
<div class="layui-input-block">
<textarea placeholder="请输入内容" class="layui-textarea"></textarea>
</div>
</div>

layui 的学习

  7.按钮

<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit lay-filter="*">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
<button class="layui-btn">一个标准的按钮</button>
<a href="http://www.baidu.com" class="layui-btn">一个可跳转的按钮</a>

layui 的学习

  8.动画

  layui-anim(必须)  layui-anim-scaleSpring(对应的效果)   layui-anim-loop(循环可选)

  

<div class="layui-anim layui-anim-scaleSpring layui-anim-loop">
动画
</div>

  9. 选项卡

  

......................