The content and structure.
The appearance and layout.
The logic and interaction.
A strong web page separates meaning, style, and behavior so each part is easier to update.
Most projects keep HTML in the main folder and place CSS, JavaScript, and image assets in their own folders.
Start by finding index.html. It is usually the main page opened by the browser and is commonly used by GitHub Pages.
HTML uses elements to describe what content is: headings, paragraphs, images, links, lists, sections, forms, and buttons.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My Page</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<h1>Hello, 5041!</h1>
<script src="js/script.js"></script>
</body>
</html>
HTML tags structure web pages and format content for web browsers.
Starts an element, like <h1>.
The text, image, link, or item shown on the page.
Ends an element, like </h1>.
<h1>Hello, 5041!</h1>Headings organize page sections.
Paragraph text for readable content.
Links to pages, files, or websites.
Displays images with alt text.
Clickable action on the page.
Collects user input.
Type HTML in the editor and run it to see the preview update.
CSS chooses colors, fonts, sizes, spacing, layout, and responsive behavior.
body {
font-family: Arial, sans-serif;
background: #1f1f1f;
color: white;
}
.card {
padding: 1rem;
border-radius: 12px;
}
CSS can be written directly in HTML, but it gets harder to reuse and maintain.
A better practice is to link a separate CSS file inside the <head>.
<link rel="stylesheet" href="css/style.css">CSS selectors can target groups of elements, specific classes, or unique IDs.
p targets all paragraphs.
.card targets anything with class="card".
#main-title targets one unique element.
p { font-size: 40px; }
.card { border: 3px solid rgb(100, 50, 50); }
#main-title { color: #980000; }
Change the CSS in the style section and run the page.
The CSS box model treats every HTML element as a box made of content, padding, border, and margin.
These layers determine the element’s size and the space around it.
CSS layout tools control how elements are arranged and spaced on a webpage.
Best for arranging items in one row or one column.
Best for two-dimensional layouts with rows and columns.
Edit either example to see how the layout changes.
Screen sizes vary and browser windows can be resized during use.
Responsive pages adjust to different display sizes.
@media only screen and (min-width: 400px) { ... }
@media only screen and (min-width: 700px) { ... }
@media only screen and (min-width: 1000px) { ... }
JavaScript can respond to clicks, update text, validate forms, fetch data, and change the page without reloading.
const button = document.querySelector('#refresh');
button.addEventListener('click', function () {
console.log('Refresh requested');
});
Useful for quick tests, but can become messy.
A better practice is to add a separate JavaScript file near the end of the body.
<script src="js/script.js"></script>If JavaScript is new to you, practice variables, functions, conditionals, events, arrays, and DOM selection.
These skills make interactive websites and web apps possible.
console.log() to check JavaScript values.The browser cannot find the CSS, JS, or image file.
One missing quote, bracket, or semicolon can break code.
JavaScript or CSS targets a class or ID that does not exist.
The browser shows an older copy. Hard refresh and test again.
Right-click a page and choose Inspect.
View and test HTML and CSS.
Read JavaScript errors and test commands.
Check file and API requests.
An Integrated Development Environment combines tools for writing, running, testing, and debugging code in one place.
JSFiddle is useful for simple web development and testing. Visual Studio Code is another development tool for local projects.
<main class="card">
<h1>BEARY Viewer</h1>
<p>Click the button to display BEARY the safety bear.</p>
<button id="beary-button">Show BEARY</button>
<div id="image-container"></div>
</main>
body {
margin: 0;
min-height: 100vh;
display: grid;
place-items: center;
font-family: Arial, sans-serif;
background: #1f1f1f;
color: white;
}
.card {
width: min(500px, 85%);
padding: 30px;
text-align: center;
background: #303030;
border-top: 6px solid #980000;
border-radius: 10px;
}
button {
padding: 12px 20px;
border: none;
border-radius: 6px;
background: #980000;
color: white;
font-size: 18px;
font-weight: bold;
cursor: pointer;
}
button:hover {
background: #666666;
}
#image-container {
margin-top: 24px;
}
#image-container img {
width: 100%;
border-radius: 8px;
}
const button = document.querySelector("#beary-buton");
const imageContainer = document.querySelector("#image-container");
button.addEventListener("click", function () {
const bearyImage = document.createElement("img");
bearyImage.src =
"https://github.com/5041CyBears/training-modules/blob/main/assets/BEARY.png?raw=true";
bearyImage.alt = "BEARY the Safety Bear";
imageContainer.replaceChildren(bearyImage);
});
The page loads, but clicking the button does not display the image. Find and fix the error.
id.null.The selector contains a misspelling. It uses #beary-buton instead of #beary-button.
const button = document.querySelector("#beary-button");
Each question is on its own slide.
Answer all 20 questions, then grade the quiz. Score at least 18 out of 20 to unlock the completion certificate.
This name will appear on your completion certificate.
What is the main role of HTML?
What is the main role of CSS?
What is the main role of JavaScript?
Which file is usually the main webpage opened by a browser or GitHub Pages?
Which tag is used for a paragraph?
What does an opening tag do?
Which selector targets a class named card?
Which selector targets one unique ID named main-title?
What are the parts of the CSS box model?
Which layout tool is best for one row or one column?
Which layout tool is best for rows and columns?
What does a media query help with?
Where should a separate JavaScript file usually be linked?
What is DevTools useful for?
What does console.log() help with?
What should you check if an image or CSS file does not load?
What is a common cause of JavaScript selector errors?
What is JSFiddle useful for?
What is the bug in the starter JavaScript?
What is the best debugging habit?
You need at least 18 out of 20 to unlock the completion certificate.
Not submitted.
After passing, advance to the final completion certificate.
5041 CyBear Robotics
Presented to
for successfully completing the
Complete after passing the required quiz.
Everyone has a place here.