-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
93 lines (68 loc) · 2.75 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Document</title>
</head>
<style>
body {
font-family: Verdana, sans-serif;
font-size: 0.8em;
}
h1,
div {
border: 1px solid grey;
margin: 5px;
padding: 8px;
}
div {
background-repeat: no-repeat;
background-attachment: fixed;
background-size: 100% 100%;
}
</style>
<body>
<div>
<h1>HTML Button</h1>
<div>
<h2>Default Button</h2>
<button>I'm a Button</button>
</div>
<div>
<h2>Button Type</h2>
<h4>type="button"</h4>
<button type="button">I'm a Button with type attribute button</button>
<h4>type="submit" with button element</h4>
<form action="index.html">
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" value="John"><br>
<button type="submit">Submit</button>
</form>
<h4>type="submit" with input element</h4>
<form action="index.html">
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" value="John"><br>
<input type="submit" value="Submit">
</form>
<h4>type="reset" with input element</h4>
<form action="/action_page.php">
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname"><br>
<input type="reset" value="Reset">
</form>
</div>
<div>
<h2>Styled Button</h2>
<button name="button" type="button"
style="margin: 16px; padding: 16px; background-color: darkblue; color: aliceblue; border: none;border-radius: 4px;font-size: 12px">Styled
button</button>
</div>
<div>
<h2>Button with Javascript</h2>
<button onClick="window.location.href = 'https://google.com'" style="padding: 16px; background-color: darkblue; color:aliceblue; border-radius: 4px;font-size: 12px">Go to Google</button>
<button onClick="document.location.href = 'page2.html'" style="padding: 16px; background-color: darkblue; color:aliceblue; border-radius: 4px;font-size: 12px">Go to Page 2</button>
<h4>Button onClick Show Alert</h4>
<button name="button" type="button" style="margin: 16px; padding: 16px; background-color: darkblue; color: aliceblue;border-radius: 4px;font-size: 12px" onClick="alert('Hello World!')">Click Me!</button>
</div>
</div>
</body>
</html>