Boostrap之模拟框使用
文章目录
前言
本文是关于使用boostrap模拟框实现“设备注册”
一、实现结果
二、代码实现
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Bootstrap 实例 - 模态框(Modal)插件</title>
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<body>
<h2>创建模态框(Modal)</h2>
<!--bootstrap-----模态框-->
<h2>模态框(Modal)</h2>
<!-- 按钮触发模态框 -->
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
登陆
</button>
<!-- 模态框(Modal) -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="true">
<div class="modal-dialog">
<div class="modal-content">
<!--登陆框头部-->
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
×
</button>
<h4 class="modal-title" id="myModalLabel">
添加新的智能设备
</h4>
</div>
<!--登陆框中间部分(from表单)-->
<div class="modal-body">
<form class="form-horizontal" role="form">
<!--用户框-->
<div class="form-group">
<label for="Equip_name" class="col-sm-2 control-label">设备名</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="Equip_name" placeholder="Equip_name" required="required">
</div>
</div>
<!--密码框-->
<div class="form-group">
<label for="password" class="col-sm-2 control-label">类型选择</label>
<div class="col-sm-10">
<label class="radio-inline">
<input type="radio" name="optionsRadiosinline" id="optionsRadios3" value="option1" checked > 电灯
</label>
<label class="radio-inline">
<input type="radio" name="optionsRadiosinline" id="optionsRadios4" value="option2"> 热水器
</label>
<label class="radio-inline">
<input type="radio" name="optionsRadiosinline" id="optionsRadios4" value="option2"> 空调
</label>
</div>
</div>
<!--添加按钮-->
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-default">添加</button>
</div>
</div>
</form>
</div>
</div>
</div>
<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
</body>
</html>