-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
87 lines (80 loc) · 1.76 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Basic Page with Navbar</title>
<style>
/* Navbar styling */
nav {
background-color: #333;
padding: 10px;
}
nav ul {
list-style-type: none;
display: flex;
padding: 0;
margin: 0;
}
nav ul li {
margin-right: 20px;
}
nav ul li a {
color: white;
text-decoration: none;
font-weight: bold;
}
nav ul li a:hover {
color: #ddd;
}
/* Body styling */
body {
font-family: Arial, sans-serif;
text-align: center;
margin: 20px;
}
img {
width: 300px;
height: auto;
margin: 20px 0;
}
button {
padding: 10px 20px;
margin: 10px;
font-size: 16px;
cursor: pointer;
}
#displayText {
margin-top: 20px;
font-size: 18px;
font-weight: bold;
color: #333;
}
</style>
</head>
<body>
<!-- Navbar -->
<nav>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#services">Services</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</nav>
<!-- Body Content -->
<h1>Welcome to My Website</h1>
<img src="https://via.placeholder.com/300" alt="Sample Image">
<!-- Buttons -->
<button onclick="displayText('Button 1 was clicked!')">Button 1</button>
<button onclick="displayText('Button 2 was clicked!')">Button 2</button>
<!-- Text Display Area -->
<div id="displayText"></div>
<!-- Script for displaying text -->
<script>
function displayText(message) {
document.getElementById('displayText').innerText = message;
}
</script>
</body>
</html>