0
當我在不同的分辨率屏幕之間切換時,頁腳位於底部或底部的上方,導致滾動條出現。我怎樣才能解決這個問題與CSS?我已經嘗試了幾個帖子,但我不確定我做錯了什麼。頁腳在頁面底部的位置不正確
陣營代碼:
return (
<div>
<div className="container">
<div id="logo">
<img src={require('../../images/vidn_logo.png')} />
</div>
{heading}
<form className="form-signin" onSubmit={this.formSubmit}>
<input onChange={this.setEmail} type="email" className="login-form-control"
autoComplete="email" placeholder="Email" required></input>
<input onChange={this.setPass} type="password" className="login-form-control"
autoComplete="new-password" placeholder="Password" required></input>
<button className="btn btn-lg btn-primary btn-block"
type="submit" style={{marginTop: '20px'}}>Log In</button>
</form>
</div>
<Footer />
</div>
);
頁腳部分
const Footer = React.createClass({
render: function() {
return (
<div id="footer">
<div id="footerText">
<a href="">Privacy</a>All rights reserved<br />
<a href=""
title="Support Contacts & Procedures">Customer Support</a>
</div><br />
</div>
);
}
});
的.css:
html {
height: 100%;
margin: 0;
padding: 0;
box-sizing: border-box;
}
*,
*:before,
*:after {
box-sizing: inherit;
margin: 0;
padding: 0;
}
body {
position: relative;
margin: 0;
background: #FBFCFE;
font-family: Arial, Verdana, Helvetica, sans-serif;
font-size: 11px;
color: #2B2B2B;
height: 100%;
}
div {
display: block;
}
.container {
width: auto;
height: 100%;
padding: 60px 0 100px;
text-align: center;
}
#footer {
margin-top: -100px; /* negative value of footer height */
height: 100px;
clear:both;
color: #3f4209;
text-align: right;
background: #ccc9c9;
}
#footer div#footerText {
width: 99%;
padding: 10px 10px;
}
爲什麼,而不是說'下這樣用'保證金top'位置:0' – 1252748