πŸ–¨ XP Quests Workbook

All cheat sheets + glossary in one printable pack

Name: ______________________

Reference

🧱 HTML Cheat Sheet

Every brick you have learned, in one place. Print me out!

The pattern

<tag attribute="extra info"> content </tag>
 ↑opening tag                          ↑closing tag (has a /)

The skeleton (every page starts like this)

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Shows in the browser TAB</title>
    <style> /* CSS goes here */ </style>
  </head>
  <body>
    ...everything people SEE goes here...
    <script> /* JavaScript goes here, at the end */ </script>
  </body>
</html>

Content bricks

TagWhat it doesLearned in
<h1>...<h6>Headlines, biggest to smallest. One <h1> per page.L1, L3
<p>A paragraph of normal text.L1
<strong>Bold, important words.L3
<ul> + <li>Bullet list + its items (bricks inside bricks).L3
<ol> + <li>Numbered list + its items.L3
<img src="..." alt="...">A picture. No closing tag! src=which picture, alt=words if it can't be seen.L3
<a href="...">A link. href=where to go (a URL or a file next door).L4
<button>A clickable button (give it an id so JS can find it).L8
<div>A plain box for grouping bricks. Name it with class="...".L6

Meaningful boxes (semantic tags)

Same as <div>, but their NAMES tell everyone (humans and AIs!) what the box is for:

TagWhat it's for
<header>The top of the page β€” usually the hero section
<main>The main content in the middle
<section>One chapter of the page (features, reviews...)
<footer>The bottom strip β€” small print and links

Attributes you know

AttributeMeaning
src="..."Which file/picture to load (on <img>, <script>)
alt="..."Backup words for a picture
href="..."Where a link goes (on <a>)
class="..."A group name β€” many bricks can share it (CSS: .name)
id="..."A unique name β€” only ONE brick has it (CSS: #name, JS: getElementById)

How to make and open a page

  1. Create a file that ends in .html (like myshop.html) in a text editor.
  2. Write your tags and content, then save (⌘S).
  3. Open the file in a browser (double-click it, or drag it onto the browser).
  4. Changed something? Save again, then press refresh (⌘R) in the browser.

Reference

🎨 CSS Cheat Sheet

The paint of the house. Print me out!

The pattern

selector {            /* WHO gets painted        */
  property: value;    /* WHAT about them: choice */
}

Rules live inside a <style> tag in the <head>. Every rule needs its { } braces, and every line ends with ;

Selectors β€” WHO

SelectorPicksExample
h1Every element of that tagh1 { color: purple; }
.cardEverything with class="card".card { padding: 16px; }
#buyThe ONE element with id="buy"#buy { background: gold; }

Properties β€” WHAT

PropertyChangesExample value
colorText colortomato, #222
background-colorFill color of the boxgold, lavender
font-familyThe letter stylesans-serif
font-sizeLetter size20px
text-alignText positioncenter
paddingSpace INSIDE the box edge16px
marginSpace OUTSIDE the box24px
borderThe frame around the box3px solid purple
border-radiusRound corners12px, 50%=circle

The box model πŸ“¦

β”Œβ”€ margin ──────────────────────┐   space to OTHER boxes
β”‚  β”Œβ”€ border ────────────────┐  β”‚   the frame
β”‚  β”‚  β”Œβ”€ padding ─────────┐  β”‚  β”‚   space inside the frame
β”‚  β”‚  β”‚     content       β”‚  β”‚  β”‚   your text / picture
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Flexbox β€” the train πŸš‚

.row {                      /* the PARENT is the track   */
  display: flex;            /* kids line up in a row     */
  gap: 16px;                /* space between train cars  */
  justify-content: center;  /* where the train sits      */
  align-items: center;      /* line up tops and bottoms  */
}

Remember: display: flex goes on the parent, and it moves the children.

Sneaky facts

Reference

⚑ JavaScript Cheat Sheet

The electricity of the house. Print me out!

Where it lives

<script>
  ...your JavaScript...
</script>      <!-- at the END of <body>, after your HTML bricks -->

Why at the end? The browser reads top-to-bottom β€” the bricks must exist BEFORE the script tries to find them.

The magic 3-line spell

const btn = document.getElementById("buy");   // 1. find the brick
btn.addEventListener("click", function () {   // 2. when clicked...
  document.getElementById("msg").textContent = "πŸŽ‰ Thanks!";  // 3. ...do this
});
PieceWhat it means
const btn = ...Make a name (btn) for something, so you can use it later
document.getElementById("buy")Find the ONE brick with id="buy"
addEventListener("click", ...)"When this gets clicked, run my function"
function () { ... }A recipe of steps, waiting to be run
el.textContent = "..."Replace the words inside a brick
el.style.backgroundColor = "gold"Change CSS from JavaScript

Memory boxes (variables)

const price = 5;        // a box that never changes
let coins = 0;           // a box you can refill
const name = "Robo";     // quotes = words (a string)
coins = coins + 1;       // refill: old value + 1
"Price: " + price        // gluing words and numbers

Decisions (if / else)

if (coins >= 10) {          // ask a question
  msg.textContent = "Rich!";
} else if (coins === 1) {   // another question
  msg.textContent = "One coin.";
} else {                    // everything else
  msg.textContent = "Keep clicking!";
}

Functions (your own spells)

function cheer(name) {          // DEFINE the spell (nothing happens yet)
  return "Go " + name + "!";    // return = hand the answer back
}
cheer("Robo Sneakers");         // CAST the spell (now it happens)

Lists & loops

const features = ["fast", "cool", "cheap"];  // a train of boxes
features[0]              // "fast" β€” counting starts at ZERO!
features.length          // 3

let html = "";
for (const f of features) {          // for each thing in the train...
  html = html + "<li>" + f + "</li>";
}
list.innerHTML = html;   // innerHTML reads the words as HTML bricks

Sneaky facts

Reference

πŸ“– Glossary β€” Web Words Explained

Every strange word from the lessons, explained in normal-kid language.

The big three

WordWhat it means
HTMLThe language for the content and structure of a page β€” the walls of the house. (HyperText Markup Language)
CSSThe language for how a page looks β€” the paint. (Cascading Style Sheets)
JavaScriptThe language that makes a page do things β€” the electricity. Not related to Java (confusing, we know).

HTML words

WordWhat it means
TagA label in angle brackets. <h1> opens, </h1> (with the slash) closes.
ElementA complete brick: opening tag + content + closing tag. <p>Hi!</p> is one element.
AttributeExtra info inside an opening tag: <img src="cat.jpg" alt="a cat">. Name = value, in quotes.
classA group name you invent for bricks: class="card". Many bricks can share one class. CSS finds them with .card.
idA unique name for exactly ONE brick: id="buy". CSS finds it with #buy, JavaScript with getElementById("buy").
SkeletonThe frame every page needs: <!DOCTYPE html>, <html>, <head> (invisible info) and <body> (visible stuff).
Semantic tagA box with a meaningful name β€” <header>, <main>, <section>, <footer> β€” so readers (and AIs) instantly know what it's for.
NestingBricks inside bricks, like <li> items living inside a <ul> list. Inner bricks must close before outer ones.

CSS words

WordWhat it means
SelectorThe WHO of a CSS rule β€” which bricks get painted. h1, .card, #buy.
PropertyThe WHAT β€” which thing about them changes: color, padding, font-size.
ValueThe choice: purple, 16px, center.
Box modelThe secret: every element is a box with layers β€” content, then padding (space inside), then border (the frame), then margin (space to other boxes).
FlexboxA layout tool: put display: flex on a parent box and its children line up like train cars.

JavaScript words

WordWhat it means
ScriptA list of instructions for the browser to run, inside a <script> tag at the end of <body>.
FunctionA recipe of steps with a name (or no name), waiting to be run β€” like a saved spell.
Event / listenerAn event is something that happens (a click!). A listener (addEventListener) is a robot ear that waits for it and then runs your function.
ConsoleThe browser's secret window where errors appear in red. Right-click β†’ Inspect β†’ Console. Engineers live here.
constMakes a name for a thing so you can use it later: const btn = .... Short for "constant".
VariableA labeled memory box that holds a value. const = a box that never changes, let = a box you can refill.
StringWords in quotes: "hello". Even "5" is words, not a number β€” quotes decide!
NumberA value with no quotes that math works on: 5 + 5 is 10, but "5" + 5 is "55" (gluing).
if / elseCode that chooses a path: if (question) { do this } else { do that }. Remember: = puts, === asks.
ParameterThe ingredient slot of a function: in function cheer(name), name is the slot you fill when you call it.
returnHow a function hands its answer back. No return = undefined (an empty box).
undefinedJavaScript's way of saying "this box is empty / doesn't exist". You'll meet it a thousand times. It's a clue, not a disaster.
ArrayA train of boxes in one variable: ["fast", "cool", "cheap"]. Counting starts at ZERO: [0] is the first one.
LoopCode that repeats: for (const f of features) { ... } runs once for every item in the train.
innerHTMLLike textContent, but the words are read as HTML bricks β€” so "<li>fast</li>" becomes a real list item.

General words

WordWhat it means
BrowserThe app that reads HTML files and draws them β€” Chrome, Safari, Firefox.
FileA saved document. Web pages end in .html.
URLAn internet address, like https://google.com. In href or src, it can also just be a neighbor file's name.
Landing pageA one-page website whose whole job is to make one product look amazing. Anatomy: hero β†’ features β†’ footer.
Hero sectionThe big top part of a landing page: giant headline, one-sentence promise, and a button.
Vibe codingBuilding software by telling an AI what you want. Works best when you can READ what the AI wrote β€” which is the whole point of this course.
PromptYour work order to the AI. A pro prompt says: WHAT to build, WHO it's for, the PARTS, the RULES, and the BEHAVIOR.
IterateImproving in small steps: ask for one small change, test it, then ask for the next. Beats "redo everything" every time.
Bug reportHow pros ask for help: "I expected X. Instead Y happens. Here's the console error: [paste]. Here's my code: [paste]."
Code reviewReading code BEFORE accepting it β€” skimming the structure, checking the names, following one thread. Never paste in what you haven't skimmed.
classListJavaScript's sticker tool: el.classList.add("open"), .remove, .toggle β€” put a class sticker on or take it off, so different CSS applies. All over AI code.