写一个美观的html注册表单要有姓名性别男女可选喜好有4个可选学历大专和本科可选简介详细一点。
<!DOCTYPE html>
<html>
<head>
<title>注册表单</title>
<meta charset="utf-8">
<style type="text/css">
form {
margin: 0 auto;
width: 400px;
padding: 20px;
background-color: #f2f2f2;
border-radius: 5px;
box-shadow: 0 0 5px #999;
}
<pre><code> label {
display: inline-block;
margin-bottom: 10px;
font-weight: bold;
}
input[type="text"], select, textarea {
padding: 5px;
border-radius: 3px;
border: 1px solid #ccc;
width: 100%;
margin-bottom: 20px;
box-sizing: border-box;
}
input[type="radio"] {
margin-right: 10px;
}
input[type="submit"] {
background-color: #4CAF50;
color: #fff;
padding: 10px 20px;
border: none;
border-radius: 3px;
cursor: pointer;
font-size: 16px;
margin-top: 20px;
}
input[type="submit"]:hover {
background-color: #3e8e41;
}
</style>
</code></pre>
</head>
<body>
<form>
<label>姓名:</label><br>
<input type="text" name="name" required><br>
<pre><code> <label>性别:</label><br>
<input type="radio" name="gender" value="male" checked>男
<input type="radio" name="gender" value="female">女<br>
<label>喜好:</label><br>
<input type="checkbox" name="hobby" value="reading">阅读
<input type="checkbox" name="hobby" value="music">音乐
<input type="checkbox" name="hobby" value="sports">运动
<input type="checkbox" name="hobby" value="travel">旅行<br>
<label>学历:</label><br>
<select name="education">
<option value="college">大专</option>
<option value="undergraduate">本科</option>
</select><br>
<label>简介:</label><br>
<textarea name="introduction" rows="6"></textarea><br>
<input type="submit" value="注册">
</form>
</code></pre>
</body>
</html>
原文地址: https://www.cveoy.top/t/topic/66v 著作权归作者所有。请勿转载和采集!