Firstly, you need to have basic knowledge of HTML, CSS, and JavaScript.
After knowing the basics, let's start:
***What's the requirements
- An operating system because you can't operate your computer without it.
- A code editor
Now you have two options which defines you:
- Notepad
- VSCode
if you chose Vscode you maded a hard decision of yur life, that is you are becoming a developer,
but if you chose Notepad, so sorry but you need to grow more to be developer.
- Browser
- and there is nothing more so let's start
It is simple to develop a website so we develop this website with a example
***Lets give a structure to our website using the legend HTML
- Make a file with .html extension in VScode.
- Copy this code and paste it in the file you've created
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My First Webpage with JavaScript</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f0f0f0;
color: #333;
margin: 0;
padding: 0;
}
header {
background-color: #4CAF50;
color: white;
text-align: center;
padding: 1rem;
}
section {
padding: 20px;
text-align: center;
}
h1 {
color: #fff;
}
p {
font-size: 1.2em;
}
button {
background-color: #4CAF50;
color: white;
border: none;
padding: 10px 20px;
font-size: 1em;
cursor: pointer;
}
button:hover {
background-color: #45a049;
}
footer {
background-color: #333;
color: white;
text-align: center;
padding: 1rem;
position: absolute;
bottom: 0;
width: 100%;
}
</style>
</head>
<body>
<header>
<h1>Welcome to My First Webpage</h1>
</header>
<section>
<h2>About This Page</h2>
<p>This is a simple webpage created using basic HTML,
CSS, and JavaScript. Click the button below for a surprise!</p>
<button onclick="displayMessage()">Click Me</button>
</section>
<footer>
<p>© 2024 My First Webpage</p>
</footer>
<script>
function displayMessage() {
alert("Hello! Welcome to the world of web development.");
}
</script>
</body>
</html>
***Explaination
style tag contains the basic styling of this website
script tag conatains the basic javascript code to make you familiar with javascript.
and other code is the html
- Save it
- open the file location and double click it.