forked from jackfrued/Python-100-Days
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample_of_form.html
106 lines (106 loc) · 2.61 KB
/
example_of_form.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>表单的例子 - 注册</title>
<style>
/* 属性选择器 */
/* form input 后代选择器 */
/* form>input 儿子选择器 */
form input[type=text], form input[type=password] {
border: none;
outline: none;
border-bottom: 1px dotted darkgray;
}
/* form~input 兄弟选择器 */
/* form+input 相邻兄弟选择器 */
form~p>input[type=text] {
outline: none;
border: 1px solid lightgray;
}
form~p>input[type=text]:focus {
outline: none;
border: 1px solid #00FFFF;
}
.button {
display: inline-block;
color: white;
background-color: red;
border: none;
width: 120px;
height: 40px;
}
</style>
</head>
<body>
<figure>
<img src="images/bok-choi.jpg" alt="">
<figcaption>图1. 这是一个图片</figcaption>
</figure>
<form action="" method="post" enctype="multipart/form-data">
<fieldset>
<legend>用户基本信息</legend>
<p>
用户名:
<input type="text" name="username" placeholder="用户名由6-20个字符构成" required>
</p>
<p>
密码:
<input type="password" name="password" required>
</p>
<p>
确认密码:
<input type="password" name="repassword" required>
</p>
<p>
性别:
<input type="radio" name="sex" value="1" checked>男
<input type="radio" name="sex" value="0">女
</p>
<p>
爱好:
<input type="checkbox" name="fav" value="阅读" checked>阅读
<input type="checkbox" name="fav" value="旅游">旅游
<input type="checkbox" name="fav" value="美食" checked>美食
<input type="checkbox" name="fav" value="运动">运动
</p>
<p>
省份:
<select name="province">
<option value="110000">北京</option>
<option value="120000">天津</option>
<option value="310000">上海</option>
<option value="500000">重庆</option>
<option value="510000" selected>四川省</option>
</select>
</p>
<p>
生日:
<input type="date" name="birthday">
</p>
</fieldset>
<fieldset id="">
<legend>用户附加信息</legend>
<p>
邮箱:
<input type="email" name="email" required>
</p>
<p>
头像:
<input type="file" name="photo">
</p>
<p>
自我介绍:
<textarea cols="30" rows="10" name="intro"></textarea>
</p>
<p>
<input class="button" type="submit" value="确认注册">
<input class="button" type="reset" value="重新填写">
</p>
</fieldset>
</form>
<p>
<input type="text">
</p>
</body>
</html>