Html | Css Javascript Crash Course

h1 font-size: 2rem; margin-bottom: 0.5rem;

🎯 Goal Build a dynamic "Theme Switcher" page that changes colors when you click a button. 1. HTML (Structure) HTML defines the content and layout. html css javascript crash course

button background: var(--btn-bg); color: var(--btn-text); border: none; padding: 10px 20px; font-size: 1rem; border-radius: 30px; cursor: pointer; transition: 0.2s; h1 font-size: 2rem; margin-bottom: 0

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Theme Switcher | Crash Course</title> <link rel="stylesheet" href="style.css"> </head> <body> <div class="container"> <h1>🎨 HTML + CSS + JS Crash Course</h1> <p>Click the button to switch between light and dark themes.</p> <button id="themeBtn">🌙 Dark Mode</button> <div class="demo-box"> <p>This box changes style with the theme!</p> </div> </div> <script src="script.js"></script> </body> </html> CSS handles colors, fonts, spacing, and responsiveness. button background: var(--btn-bg)

body font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); margin: 0; padding: 2rem; transition: all 0.3s ease;

.demo-box background: var(--box-bg); border: 1px solid var(--box-border); border-radius: 12px; padding: 1.5rem; margin: 2rem 0; transition: 0.2s;

/* style.css */ :root --bg: #f9f9f9; --text: #1e1e2f; --box-bg: #ffffff; --box-border: #ddd; --btn-bg: #1e1e2f; --btn-text: #f9f9f9;