-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
89 lines (79 loc) · 1.75 KB
/
index.html
File metadata and controls
89 lines (79 loc) · 1.75 KB
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
<!DOCTYPE html>
<html>
<head>
<title>
weather-web-page
</title>
<style type='text/css'>
body
{
background-image: url('weather.jpg');
background-repeat: no-repeat;
background-size: cover;
}
#city
{
font-size : 20px;
border-radius : 4px;
}
#bt1
{
font-size : 20px;
padding: 15px 30px;
text-align: center;
background-color : green;
border-radius : 4px;
color: white;
}
#hd1
{
color: red;
text-align: center;
}
#div1
{
display: flex;
justify-content: center;
}
.bg1
{
background-image: url("snowfall.jpg");
background-repeat: no-repeat;
background-size: cover;
}
.bg2
{
background-image: url("rainy.jpg");
background-repeat: no-repeat;
background-size: cover;
}
.bg3
{
background-image: url("sunny.jpg");
background-repeat: no-repeat;
background-size: cover;
}
</style>
</head>
<body id='page_body'>
<br>
<br>
<form action="main.php" method="post">
<h1 id='hd1'><label for="location">Check your weather!</label></h1>
<div id='div1'>
<input type='text' id='city' placeholder="city" name="city">
<!--change the '1' below to some variable which denotes the tye of weather at the location >
<!the background image will get changed according to the value of
variable -->
<button type="submit" name="sub">View</button>
</div>
</form>
<script type='text/javascript' >
function func_change_bg_img(x)
{
/*document.body.background-image=url("sunny.jpg");*/
document.getElementById('page_body').className="bg"+x;
}
</script>
</body>
</html>