When I Explained HTML and CSS to My 5-Year-Old Niece

I want to share what I learned about HTML and CSS from a five-year-old child.

As I started writing basic HTML, my niece entered the room. Normally loud, she stood quietly by my desk, curious.

Niece: Wassat? Wassat you typing?
Me: Something for the computer.
Niece: It looks funny. All the little lines.
Me: They are instructions.
Niece: Instwu… inschu… instwushun?
Me: Instructions.

I recalled a Quora question about explaining HTML and CSS to a child. I hadn’t considered it then, but now I wished I had.

Here’s how I explained it. It’s interesting how teaching something familiar reveals what you take for granted.

We’re building a “house” with “bricks”

My niece wasn’t interested in the HTML tags but in what appeared in the browser.

Niece: Oh. So, this big box is your house?
Me: Kind of, yes.

The screen was empty, resembling a vast space. Her observation made me explain the basics.

I told her the editor is where I place my building blocks, like her LEGO pieces. She watched as I added a heading, text, and a button without behavior.

Her eyes were glued to the screen as I refreshed the browser, and the elements appeared. She noticed the connection between the house and the LEGO pieces.

The LEGOS are just bricks in the house

I explained that HTML structures the house, stacking bricks on the screen. It doesn’t decide how they look. A heading is a heading, a paragraph is a paragraph, and a button is a different brick. The browser follows my instructions to add the bricks.

Explaining this forced me to slow down. I described HTML as the vocabulary of the page, naming each piece so the browser can build the document tree. This tree is the foundation for CSS and JavaScript. Without names, the browser wouldn’t know how elements relate.

I paused, watching her reaction, and realized something. Every polished work begins as an idea, transforming into an outline, like an interface starts with structure.

Explaining this made me appreciate the importance of separating HTML, CSS, and JavaScript.

My niece stared at the screen for a long time. Though the structure was there, the page seemed empty to her, and she asked why.

She expected a house with shapes and rooms but saw a plain surface. I pointed out the editor and semantic tags. The is a container, the is like a roof, and the

is the floor.

I explained these elements behave like rooms and doorways, not decoration. They tell the browser what exists and how parts relate, framing the document like framing a house.

Decorating the house

Once she understood structure, I added simple CSS rules. I added a width, height, and border to an element. She watched the characters appear with focus. The properties looked like unfamiliar symbols to her.

I explained CSS as instructions like HTML, but for appearance. I can tell the browser how big a brick should be, where it sits, and how it looks.

This is the essence of CSS. You select a brick and describe its appearance. Saying it reminded me that CSS is logical.

A width, a height, and a border add shape.

There might be a more academic way to teach CSS, like starting with writing modes for directionality before color. But to a five-year-old, that’s gibberish. I can’t explain aspect-ratio before width and height. Those fancy things can wait.

I sought an “A-ha!” moment. I drew a little house, refreshed the page, and the structure took shape.

It wasn’t much: a triangle roof, a square wall, two square windows, and a rectangle door. It looked like a quick pencil sketch. My niece leaned in, almost bumping her forehead on the screen.

Niece: Why does the house not have color? It looks so plain.
Me: I haven’t added color yet.
Niece: You forgot. You always forgot.
Me: I’ll add it.

I added color to the house. That’s when things clicked.

Niece: So this brick says what is there.
Me: Yes.
Niece: And this color thing makes it pretty?
Me: That’s right.
Niece: So HTML says what is there, and CSS makes it pretty.
Me: Exactly.

Her observation clarified the HTML and CSS separation. HTML describes the document tree; CSS describes appearance. Without styling, elements are present but visually absent.

“Now it looks real!” she declared. She pointed to the room’s drawers, relating them to the structure and decorations.

HTML lays the pieces; CSS brings them to life with lines, colors, and decoration. This can feel magical, right? Getting my niece to this point reminded me why the basics are satisfying.

What I learned

Similar Posts