使用bootstrap框架建立modal对话框,对话框并不能够正常显示
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用bootstrap框架建立modal对话框,对话框并不能够正常显示相关的知识,希望对你有一定的参考价值。
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width;intital-scale=1" >
<meta http-equiv="x-ua-compatible" content="IE=edge">
<title></title>
<link href="bootstrap.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">Modal title</h4>
</div>
<div class="modal-body">
<p>One fine body…</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</div>
<script src="jquery-2.1.1.js"></script>
<script src="bootstrap.js"></script>
</body>
</html>
<html lang="zh-cn">
<head>
<link rel="shortcut icon" href="../img/logo_title.ico">
<meta charset="UTF-8" http-equiv="X-UA-Compatible" content="IE=Edge">
<link rel="stylesheet" href="../ex/bootstrap.min.css">
<title>Welcome to credIT!</title>
</head>
<body id="home">
<div class="container">
<div class="btn-toolbar">
<div class="pull-right">
<a href="#login" data-toggle="modal" class="btn">登陆</a>
<a href="../php/register.php" class="btn">注册</a>
</div>
</div>
</div>
<div class="container">
<div class="modal" id="login" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-head">
<a href="#" class="close" data-dismiss="modal">×</a>
<h4>用户登陆</h4>
</div>
<div class="modal-body">
<form class="form-horizontal">
<div class="control-group">
<label class="control-label" name="username">用户名</label>
<div class="controls">
<input type="text">
</div>
</div>
<div class="control-group">
<label class="control-label" name="password">密码</label>
<div class="controls">
<input type="text">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary">登陆</button>
</div>
</div>
</div>
</div>
</div>
<script src="../ex/jquery.js"></script>
<script src="../ex/bootstrap.min.js"></script>
</body>
</html>追问
没用啊!还是不能显示!我在chrome和ie11上都试过,不显示!
以上是关于使用bootstrap框架建立modal对话框,对话框并不能够正常显示的主要内容,如果未能解决你的问题,请参考以下文章
Bootstrap modal toggle() 和 modal('show') 表现不同