我想知道如何为此创建流体布局:我有一个放置在屏幕中间的表格支架。这个支架的背景是白色的,但在左上方是透明的三角形。我已经结合SVG图形和背景属性创建了它。我发现这个解决方案并不是最好的,我在为此创建流体布局时遇到了一些问题。请查看代码,并建议您是否有一些想法。
Here is picture它应该是什么样子。
HTML:
<body id="login">
<div class="container">
<h1>Login</h1>
<div class="red-line"></div>
<p class="email-sent">Your password reset email has been sent.</p>
<section class="login">
<div class="login-header">
<a href="index.html"><img src="assets/logo_menu_white.png" alt="" class="login-logo"></a>
</div>
<div class="login-form-holder">
<input type="email" placeholder="Email address" class="input-login email-address">
<input type="passowrd" placeholder="Create password" class="input-login create-password">
<a href="forgot-password.html" class="forgot-password">FORGOT PASSWORD?</a><br>
<button class="btn-login">LOGIN</button>
</div>
</section>
<p class="new-customer">New customer? <a href="signup.html">SIGN UP</a></p>
</div>
</body>
CSS
#login, #signup, #forgot-password {
background: url('../assets/main.png');
background-size: cover;
}
#login .container, #signup .container, #forgot-password .container {
text-align: center;
margin-top: 100px;
}
section.login, section.signup, section.forgot-password-section {
max-width: 490px;
min-height: 490px;
margin: 0 auto;
position: relative;
}
.login-header, .signup-header {
position: absolute;
width: 100%;
height: 200px;
top: 0;
left: 0;
background: url('../assets/login_bg.svg') no-repeat top center;
}
.login-form-holder, .signup-form-holder {
position: relative;
background: #fff;
padding-left: 50px;
padding-right: 50px;
top: 143px;
padding-bottom: 50px;
border-radius: 0px 0px 10px 10px;
}
section.login, section.forgot-password-section {
}
#login .login-logo, #signup .login-logo, #forgot-password .login-logo {
position: relative;
float: left;
margin-left: 30px;
margin-top: 40px;
z-index: 1000;
}
#login h1, #signup h1, #forgot-password h1 {
font-style: italic;
font-weight: 200;
font-size: 36px;
color: #fff;
}
#login .email-sent {
color: #c3c3c3;
margin-bottom: 35px;
margin-top: -10px;
display: none;
}
#login .red-line, #signup .red-line, #forgot-password .red-line {
width: 150px;
margin-top: 25px;
margin-bottom: 45px;
}
#login .new-customer, #signup .new-customer, #forgot-password .new-customer {
margin-top: 60px;
color: #fff;
}
.new-customer a {
color: #fff;
font-weight: 600;
padding-bottom: 5px;
border-bottom: 1px solid #ff204a;
}
.header a, .new-customer a:hover {
text-decoration: none;
border-bottom-color: #fff;
}
#login .input-login, #signup .input-login, #forgot-password .input-login {
margin: 0;
padding: 0;
background: none;
color: #b5b5b5;
border: none;
border-bottom: 2px solid #dbdbdb;
width: 100%;
text-indent: 45px;
padding: 25px 0px;
font-size: 16px;
}
#login .input-login:focus, #signup .input-login:focus, #forgot-password .input-login:focus {
outline: none;
}
#login .email-address, #signup .your-name, #signup .email-address, #forgot-password .email-address {
margin-bottom: 25px;
}
#login .email-address, #signup .email-address, #forgot-password .email-address {
background: url('../assets/email_address_grey.svg') no-repeat;
background-size: auto 30px;
background-position: left center;
}
#login .create-password, #signup .create-password {
background: url('../assets/password_grey.svg') no-repeat;
background-size: auto 30px;
background-position: left center;
}
#signup .your-name {
background: url('../assets/your_name_grey.svg') no-repeat;
background-size: auto 30px;
background-position: left center;
}
#login .forgot-password, #signup .forgot-password {
text-align: right;
display: block;
margin-top: 20px;
font-size: 12px;
font-weight: 500;
color: #ff204a;
}
#login .forgot-password:hover, #signup .forgot-password:hover {
color: #de1c40;
text-decoration: none;
}
#signup .agree-terms {
font-size: 10px;
margin-top: 30px;
color: #5b5b5b;
}
.agree-terms a {
color: #ff204a;
padding-bottom: 2px;
border-bottom: 2px solid #ff204a;
font-weight: 500;
}
.agree-terms a:hover {
text-decoration: none;
}
#forgot-password .remark {
clear: both;
text-align: left;
margin-bottom: 40px;
line-height: 1.8;
}