<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>登录</title>
<link href="css/bootstrap.min.css" rel="stylesheet"></head><body><nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="./">jsp作业</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li><a href="login.html">登录</a></li>
</ul>
</div>
</div></nav><div class="container">
<div class="row">
<div class="col-md-4">
</div>
<div class="col-md-4">
<form class="form-signin" target="submitFrame" method="post">
<h2 class="form-signin-heading">登录到jsp作业</h2>
<label for="inputEmail">Email</label>
<input type="email" id="inputEmail" class="form-control" placeholder="请输入Email" required autofocus><br>
<label for="inputPassword">密码</label>
<input type="password" id="inputPassword" class="form-control" placeholder="请输入密码" required>
<div class="checkbox">
<label>
<input type="checkbox" value="remember-me" checked="checked">记住密码</label>
</div>
<button type="submit" class="btn btn-primary" id="btn-login">登录</button>
<a href="reg.html" class="btn btn-default">注册</a>
</form>
<iframe style="display: none" name="submitFrame" src="about:blank"></iframe>
</div>
<div class="col-md-4">
</div>
</div>
<script src="js/jquery.min.js"></script></body></html>
<form method="post" action="###" name="myform" onsubmit="checkpost()"><label for="name">用户名:</label><input type="text" name="name" id="name" /><br />
<label for="pw">密码:</label><input type="password" name="pw" id="pw" /><br />
<input type="submit" value="提交" />
</form>
<script>
function checkpost(){
if(document.forms[0].name.value=="你要的用户名"&&document.forms[0].pw.value=="你要的密码"){
window.location="你要跳转的地址"
}else{
alert("用户名或密码不正确!")
return false
}
}
</script>
你说的类似于响应式布局,这个css就能实现,有两种方法:1、用@media通过判断浏览器的分辨率(代码自动能判断)来调取不同的css样式。这就需要写不同的css,主要是宽度的调整。(http://www.w3cplus.com/content/css3-media-queries)
2、不用固定的宽度。宽度用%。而不用固定的px。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)