Web Development Chapters 1 2
Web Development Chapters 1 2
Exercises:
1. What is the difference between frontend and backend?
2. Name three frontend and three backend technologies.
3. What is a full-stack developer?
4. How do you install Node.js?
5. What is the role of a database in web development?
Answers:
1. Frontend handles UI/UX; Backend manages logic, databases, and APIs.
2. Frontend: HTML, CSS, JavaScript; Backend: Node.js, Python, PHP.
3. A full-stack developer works on both frontend and backend.
4. Download from nodejs.org, install, and verify with `node -v`.
5. A database stores and manages data for web applications.
Chapter 2: HTML & CSS Basics
Types of CSS:
1. Inline CSS: <p style="color: blue;">Blue text</p>
2. Internal CSS: <style> p { color: red; } </style>
3. External CSS: <link rel="stylesheet" href="style.css">
CSS (style.css):
body { background-color: lightblue; text-align: center; }
Exercises:
1. What is the difference between HTML and CSS?
2. Name three ways to apply CSS.
3. What is the purpose of the <a> tag?
4. Difference between id and class in CSS?
5. Write an HTML page with a heading, paragraph, and link.
Answers:
1. HTML is for structure, CSS is for styling.
2. Inline CSS, Internal CSS, External CSS.
3. The <a> tag creates hyperlinks.
4. id is unique; class can be used for multiple elements.
5. Example HTML:
<!DOCTYPE html>
<html>
<head><title>Basic Page</title></head>
<body>
<h1>Welcome</h1>
<p>This is a sample paragraph.</p>
<a href="https://example.com">Click here</a>
</body>
</html>