HTML CSS 表单设计:美观半透明表单样式
<!DOCTYPE html>
<html>
<head>
<title>美观半透明表单</title>
<style>
body {
background-color: #f2f2f2;
}
.container {
margin: 50px auto;
background-color: rgba(255, 255, 255, 0.8);
padding: 20px;
border: 1px solid black;
width: 400px;
border-radius: 5px;
}
h1 {
text-align: center;
font-size: 28px;
color: #333;
}
form {
display: flex;
flex-direction: column;
}
label {
font-size: 18px;
margin-top: 10px;
color: #333;
}
input[type='text'], input[type='password'], select, textarea {
padding: 10px;
margin: 10px 0;
border-radius: 5px;
border: none;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
font-size: 16px;
color: #333;
background-color: #f2f2f2;
}
select {
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
background-image: url('data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' width='32' height='32' fill='%23000000'%3E %3Cpath d='M28 9L16 21 4 9'/%3E %3C/svg%3E');
background-repeat: no-repeat;
background-position: right;
background-size: 15px;
}
input[type='submit'] {
background-color: #333;
color: #fff;
font-size: 18px;
padding: 10px;
border-radius: 5px;
border: none;
cursor: pointer;
margin-top: 20px;
transition: background-color 0.3s ease-in-out;
}
input[type='submit']:hover {
background-color: #555;
}
</style>
</head>
<body>
<div class='container'>
<h1>表单</h1>
<form>
<label for='name'>姓名</label>
<input type='text' id='name' name='name' required>
<label for='gender'>性别</label>
<select id='gender' name='gender'>
<option value='male'>男</option>
<option value='female'>女</option>
</select>
<label for='password'>密码</label>
<input type='password' id='password' name='password' required>
<label for='education'>学历</label>
<select id='education' name='education'>
<option value='college'>大专</option>
<option value='undergraduate'>本科</option>
</select>
<label for='resume'>简历</label>
<textarea id='resume' name='resume' rows='10'></textarea>
<input type='submit' value='提交'>
</form>
</div>
</body>
</html>
原文地址: https://www.cveoy.top/t/topic/muUQ 著作权归作者所有。请勿转载和采集!