My Basic Web Development Handout
My Basic Web Development Handout
Copy
Download
Run
<!DOCTYPE html>
<html>
<head>
<title>My First Webpage</title>
</head>
<body>
<h1>Hello, World!</h1>
<p>This is a paragraph.</p>
<a href="https://www.example.com">Visit Example</a>
</body>
</html>
<a> Hyperlink
html
Copy
Download
Run
Copy
Download
Run
<style>
h1 { color: blue; }
</style>
Copy
Download
Run
Copy
Download
selector {
property: value;
}
Example:
css
Copy
Download
body {
font-family: Arial;
background-color: lightgray;
}
h1 {
color: blue;
text-align: center;
}
Copy
Download
Run
<script>
function greet() {
alert("Hello, World!");
}
</script>
<button onclick="greet()">Click Me</button>
Variables
javascript
Copy
Download
Functions
javascript
Copy
Download
function sayHello() {
console.log("Hello!");
}
Copy
Download
Events
javascript
Copy
Download
button.addEventListener("click", function() {
alert("Button clicked!");
});
Copy
Download
Run
<!DOCTYPE html>
<html>
<head>
<title>Interactive Page</title>
<style>
body { font-family: Arial; text-align: center; }
button { padding: 10px 20px; background: blue; color: white; }
</style>
</head>
<body>
<h1 id="title">Welcome!</h1>
<button onclick="changeText()">Click Me</button>
<script>
function changeText() {
document.getElementById("title").innerHTML = "Hello, JavaScript!"
;
}
</script>
</body>
</html>
6. Next Steps
Learn responsive design (e.g., Flexbox, Grid).
Explore frameworks like Bootstrap (CSS) and React (JavaScript).
Practice by building small projects (e.g., portfolio, calculator).