layui的基本元素之一-----按钮
layui的基本元素-----按钮按钮主题按钮尺寸图标按钮圆角按钮混搭按钮按钮组按钮容器导入css样式文件:是使用者本地的路径<link rel="stylesheet" href="layui/css/layui.css" media="all">按钮主题默认按钮: class=“layui-btn”原始按钮: class=“layui-btn layui-btn-pri...
导入css样式文件:是使用者本地的路径
<link rel="stylesheet" href="layui/css/layui.css" media="all">
按钮主题
默认按钮: class=“layui-btn”
原始按钮: class=“layui-btn layui-btn-primary”
百搭按钮: class=“layui-btn layui-btn-normal”
暖色按钮:class=“layui-btn layui-btn-warm”
警告按钮:class=“layui-btn layui-btn-danger”
禁用按钮:class=“layui-btn layui-btn-disabled”
<fieldset class="layui-elem-field site-demo-button" style="margin-top: 30px;height: 80px">
<legend>按钮主题</legend>
<div>
<button type="button" class="layui-btn layui-btn-primary">原始按钮</button>
<button type="button" class="layui-btn">默认按钮</button>
<button type="button" class="layui-btn layui-btn-normal">百搭按钮</button>
<button type="button" class="layui-btn layui-btn-warm">暖色按钮</button>
<button type="button" class="layui-btn layui-btn-danger">警告按钮</button>
<button type="button" class="layui-btn layui-btn-disabled">禁用按钮</button>
</div>
</fieldset>
效果:
按钮尺寸
大型按钮:class=“layui-btn layui-btn-lg”
小型按钮:class=“layui-btn layui-btn-sm”
迷你按钮:class=“layui-btn layui-btn-xs”
默认按钮:class="layui-btn "
流体按钮:class=“layui-btn layui-btn-fluid”
<fieldset class="layui-elem-field site-demo-button">
<legend>按钮尺寸</legend>
<div>
<button type="button" class="layui-btn layui-btn-primary layui-btn-lg">大型按钮</button>
<button type="button" class="layui-btn layui-btn-primary">默认按钮</button>
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm">小型按钮</button>
<button type="button" class="layui-btn layui-btn-primary layui-btn-xs">迷你按钮</button>
<br>
<button type="button" class="layui-btn layui-btn-lg">大型按钮</button>
<button type="button" class="layui-btn">默认按钮</button>
<button type="button" class="layui-btn layui-btn-sm">小型按钮</button>
<button type="button" class="layui-btn layui-btn-xs">迷你按钮</button>
<br>
<button type="button" class="layui-btn layui-btn-lg layui-btn-normal">大型按钮</button>
<button type="button" class="layui-btn layui-btn-normal">默认按钮</button>
<button type="button" class="layui-btn layui-btn-sm layui-btn-normal">小型按钮</button>
<button type="button" class="layui-btn layui-btn-xs layui-btn-normal">迷你按钮</button>
<br>
<div style="width: 300px; margin: 0;">
<button type="button" class="layui-btn layui-btn-fluid">流体按钮</button>
</div>
</div>
</fieldset>
效果:
图标按钮
图标:
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm"><i class="layui-icon"></i></button>
效果:
<div class="layui-btn-group">
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm">
<i class="layui-icon"></i>
</button>
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm">
<i class="layui-icon"></i>
</button>
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm">
<i class="layui-icon"></i>
</button>
</div>
效果:
图标:
圆角按钮
圆角按钮:class=“layui-btn layui-btn-radius”
<fieldset class="layui-elem-field site-demo-button">
<legend>还可以是圆角按钮</legend>
<div>
<button type="button" class="layui-btn layui-btn-primary layui-btn-radius">原始按钮</button>
<button type="button" class="layui-btn layui-btn-radius">默认按钮</button>
<button type="button" class="layui-btn layui-btn-normal layui-btn-radius">百搭按钮</button>
<button type="button" class="layui-btn layui-btn-warm layui-btn-radius">暖色按钮</button>
<button type="button" class="layui-btn layui-btn-danger layui-btn-radius">警告按钮</button>
<button type="button" class="layui-btn layui-btn-disabled layui-btn-radius">禁用按钮</button>
</div>
</fieldset>
效果:
混搭按钮
<fieldset class="layui-elem-field site-demo-button">
<legend>风格混搭的按钮</legend>
<div>
<button type="button" class="layui-btn layui-btn-lg layui-btn-primary layui-btn-radius">大型加圆角</button>
<a href="http://www.layui.com/doc/element/button.html" class="layui-btn" target="_blank">跳转的按钮</a>
<button type="button" class="layui-btn layui-btn-sm layui-btn-normal"><i class="layui-icon"></i> 删除</button>
<button type="button" class="layui-btn layui-btn-xs layui-btn-disabled"><i class="layui-icon"></i> 分享</button>
</div>
</fieldset>
效果:
按钮组
按钮组:class=“layui-btn-group”
<fieldset class="layui-elem-field site-demo-button">
<legend>按钮组</legend>
<div class="layui-btn-group">
<button type="button" class="layui-btn">增加</button>
<button type="button" class="layui-btn ">编辑</button>
<button type="button" class="layui-btn">删除</button>
</div>
<div class="layui-btn-group">
<button type="button" class="layui-btn layui-btn-sm"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-sm"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-sm"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-sm"><i class="layui-icon"></i></button>
</div>
<div class="layui-btn-group">
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm">文字</button>
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm"><i class="layui-icon"></i></button>
</div>
</fieldset>
效果:
按钮容器
按钮容器:class=“layui-btn-container”
<fieldset class="layui-elem-field layui-field-title">
<legend>按钮容器</legend>
</fieldset>
<div class="layui-btn-container">
<button type="button" class="layui-btn">按钮一</button>
<button type="button" class="layui-btn">按钮二</button>
<button type="button" class="layui-btn">按钮三</button>
</div>
<div class="layui-btn-container">
<button type="button" class="layui-btn">按钮一</button>
<button type="button" class="layui-btn">按钮二</button>
<button type="button" class="layui-btn">按钮三</button>
</div>
效果:
更多推荐
所有评论(0)