我有一個登錄頁面,但有問題將登錄框中間的頁眉和頁腳沒有滾動條存在。下面是我的網頁如何中心我的登錄div
我希望做的是中心登錄框在頁眉和頁腳之間,我不希望它是scrollable.my CSS代碼和HTML下面是
@import url(https://fonts.googleapis.com/css?family=Roboto:300);
.login-page {
width: 360px;
padding: 8% 0 0;
}
.form {
position: relative;
z-index: 1;
background: #FFFFFF;
max-width: 360px;
margin: 0 auto 100px;
padding: 45px;
text-align: center;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24);
}
.form input {
font-family: "Roboto", sans-serif;
outline: 0;
background: #f2f2f2;
width: 100%;
border: 0;
margin: 0 0 15px;
padding: 15px;
box-sizing: border-box;
font-size: 14px;
}
.form button {
font-family: "Roboto", sans-serif;
text-transform: uppercase;
outline: 0;
background: #4CAF50;
width: 100%;
border: 0;
padding: 15px;
color: #FFFFFF;
font-size: 14px;
-webkit-transition: all 0.3 ease;
transition: all 0.3 ease;
cursor: pointer;
}
.form button:hover,.form button:active,.form button:focus {
background: #43A047;
}
.form .message {
margin: 15px 0 0;
color: #b3b3b3;
font-size: 12px;
}
.form .message a {
color: #4CAF50;
text-decoration: none;
}
.form .register-form {
display: none;
}
.container {
position: relative;
z-index: 1;
max-width: 300px;
margin: 0 auto;
}
.container:before, .container:after {
content: "";
display: block;
clear: both;
}
.container .info {
margin: 50px auto;
text-align: center;
}
.container .info h1 {
margin: 0 0 15px;
padding: 0;
font-size: 36px;
font-weight: 300;
color: #1a1a1a;
}
.container .info span {
color: #4d4d4d;
font-size: 12px;
}
.container .info span a {
color: #000000;
text-decoration: none;
}
.container .info span .fa {
color: #EF3B3A;
}
body {
background: white; /* fallback for old browsers
background: -webkit-linear-gradient(right, #76b852, #8DC26F);
background: -moz-linear-gradient(right, #76b852, #8DC26F);
background: -o-linear-gradient(right, #76b852, #8DC26F);
background: linear-gradient(to left, #76b852, #8DC26F);
*/
font-family: "Roboto", sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
footer {
background-color: #FFF;
position:fixed;
bottom: 0px;
width: 100%;
text-align: center;
}
header {
background-color: #FFF;
position:fixed;
top: 0px;
width: 100%;
text-align: center;
}
<body>
<header class="bgm-green m-b-30">
<ul class="h-inner">
<li class="hi-logo m-10" >
<img id="logo-image" class="logo-image" src="img/logo.png" alt="Logo">
</li>
<li class="pull-right">
\t \t \t \t <h2 class="c-white m-r-15 f-300"></h2>
\t \t \t </li>
</header>
<section id="content" class="bgm-white">
<div >
<div class="login-page">
<div class="form">
<form class="login-form">
<div class="input-group m-b-20">
<span class="input-group-addon"><i class="zmdi zmdi-account"></i></span>
<div class="fg-line">
<input type="text" class="form-control" placeholder="Username">
</div>
</div>
<div class="input-group m-b-20">
<span class="input-group-addon"><i class="zmdi zmdi-lock"></i></span>
<div class="fg-line">
<input type="password" class="form-control" placeholder="Password">
</div>
</div>
<label class="checkbox">
<input id="checker" type="checkbox" value="">
<i class="input-helper"></i>
<span>Remember me</span>
</label>
<button>login</button>
<p class="message">Unable to login? Contact our admin <a href="#">here</a></p>
</form>
</div>
</div>
</div>
</section>
<footer class="bgm-green">
<div class="c-white">
Copyright © 2016 First High Tower Infotech
</div>
</footer>
<!-- Older IE warning message -->
<!--[if lt IE 9]>
<div class="ie-warning">
<h1 class="c-white">Warning!!</h1>
<p>You are using an outdated version of Internet Explorer, please upgrade <br/>to any of the following web browsers to access this website.</p>
<div class="iew-container">
<ul class="iew-download">
<li>
<a href="http://www.google.com/chrome/">
<img src="img/browsers/chrome.png" alt="">
<div>Chrome</div>
</a>
</li>
<li>
<a href="https://www.mozilla.org/en-US/firefox/new/">
<img src="img/browsers/firefox.png" alt="">
<div>Firefox</div>
</a>
</li>
<li>
<a href="http://www.opera.com">
<img src="img/browsers/opera.png" alt="">
<div>Opera</div>
</a>
</li>
<li>
<a href="https://www.apple.com/safari/">
<img src="img/browsers/safari.png" alt="">
<div>Safari</div>
</a>
</li>
<li>
<a href="http://windows.microsoft.com/en-us/internet-explorer/download-ie">
<img src="img/browsers/ie.png" alt="">
<div>IE (New)</div>
</a>
</li>
</ul>
</div>
<p>Sorry for the inconvenience!</p>
</div>
<![endif]-->
<!-- Javascript Libraries -->
<!-- Placeholder for IE9 -->
<!--[if IE 9 ]>
<script src="vendors/bower_components/jquery-placeholder/jquery.placeholder.min.js"></script>
<![endif]-->
<script data-main="lib/js/config" src="lib/js/Requirejs.js"></script>
<script>
\t \t require(['config'], function(){
\t \t \t require(['js/loaders/loginloader']);
\t \t });
\t </script>
</body>
你把CSS代替HTML的程式碼中:-P –
下來選民親切地說出我怎麼能改善它,並給出答案。 –