-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path12-forms.html
94 lines (85 loc) · 2.44 KB
/
12-forms.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Forms</title>
<style>
form {
padding: 20px;
border: 1px solid gray;
margin-top: 10px;
display: flex;
flex-direction: column;
gap: 5px;
}
.stretch-last {
display: flex;
align-items: center;
gap: 6px;
}
.stretch-last :last-child {
flex-grow: 1;
}
.aling-center {
display: flex;
align-items: center;
}
input:last-child {
outline: none;
}
input.styled {
outline: none;
border: none;
box-shadow: 1px 1px 4px black;
padding: 10px;
}
button.styled {
background-color: darkgrey;
padding: 10px;
color: white;
border: none;
}
button.styled:hover {
background-color: rgb(119, 119, 119);
}
</style>
</head>
<body>
<form action="#">
<h2>Order form</h2>
<div class="stretch-last">
<label for="nameIn" accesskey="n"><u>N</u>ame:</label>
<input id="nameIn" type="text" placeholder="Enter your name">
</div>
<div class="stretch-last">
<label>Email address:</label>
<input type="email" placeholder="Enter email address"/>
</div>
<div>
<label class="aling-center">
<span>Check me</span>
<input type="checkbox">
</label>
</div>
<input type="color" name="" id="">
<input type="date" name="" id="">
<input type="file" name="" id="">
<input type="month" name="" id="">
<label>Price:</label>
<input type="number" min="100" max="1000" step="50">
<input type="range" name="" id="">
<input type="time" name="" id="">
<input class="styled" type="url" name="" id="">
<button class="styled" type="reset">Reset</button>
<button type="submit">Accept</button>
</form>
<script>
const submitBtn = document.querySelector('form *[type="submit"]');
submitBtn.onclick = (event) => {
event.preventDefault();
console.log("Clicked!");
}
</script>
</body>
</html>