HTML:
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>简书登录</title>
<link rel="stylesheet" href="style1.css">
</head>
<body>
<div class="container">
<div class="wrapper">
<div class="left-section">
<img src="images/简书手机.jpg" alt="App Image">
<button class="download-btn">下载简书APP</button>
</div>
<div class="right-section">
<h2>登录</h2>
<form>
<input type="text" placeholder="手机号或邮箱" required>
<input type="password" placeholder="密码" required>
<div class="remember-me">
<input type="checkbox" id="remember-me">
<label for="remember-me">记住我</label>
<a href="#">登录遇到问题?</a>
</div>
<button type="submit">登录</button>
</form>
<div class="social-login">
<span>社交账号登录</span>
<div class="social-icons">
<img src="images/微信.jpg" alt="Weibo">
<img src="images/微博.jpg" alt="WeChat">
<img src="images/QQ.jpg" alt="QQ">
</div>
</div>
</div>
</div>
</div>
</body>
</html>
CSS:
body {
font-family: 'Arial', sans-serif;
background-color: #f0f0f0;
margin: 0;
padding: 0;
}
.container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
gap: 20px; /* 添加间距 */
}
.wrapper {
display: flex;
width: 100%;
max-width: 900px;
box-sizing: border-box;
}
.left-section, .right-section {
width: 50%;
padding: 20px;
box-sizing: border-box;
}
.left-section img {
max-width: 100%;
border-radius: 15px;
}
.download-btn {
background-color: #ff6b6b;
color: white;
border: none;
padding: 10px 20px;
border-radius: 20px;
margin-top: 20px;
cursor: pointer;
display: block;
width: fit-content;
}
.right-section {
background-color: white;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, .1);
padding: 20px;
}
.right-section h2 {
margin-bottom: 20px;
}
.right-section form input[type="text"],
.right-section form input[type="password"] {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
margin-bottom: 15px;
}
.remember-me {
display: flex;
align-items: center;
margin-bottom: 20px;
}
.remember-me label {
margin-left: 5px; /* 减少左边距 */
}
.right-section button {
width: 100%;
padding: 15px;
background: linear-gradient(135deg, #007bff, #0056b3);
color: white;
border: none;
border-radius: 25px;
cursor: pointer;
transition: background-color 0.3s;
}
.right-section button:hover {
background: linear-gradient(135deg, #0056b3, #00338a);
}
.social-login {
margin-top: 20px;
text-align: center;
}
.social-login span {
display: block;
margin-bottom: 10px;
}
.social-icons img {
width: 30px;
height: 30px;
margin: 0 10px;
}
@media (max-width: 768px) {
.container {
flex-direction: column;
}
.left-section, .right-section {
width: 100%;
}
}
最终效果图: