PythonIntermediate PythonNumPySQLGen AI
HTMLCSSJavaScriptIntermediate JavaScriptReactp5.jsNode.js
Command LineGit & GitHub
C++JavaData Structures & Algorithms

Exercise

02. Elemental

Elements

To understand how HTML works, we need to start with elements – the smallest building blocks of the language.

An element usually consists of an opening tag, the content, and a closing tag. A tag is enclosed in angle brackets.

<p>Hello World!</p>

So this is one HTML element where:

  • <p> is the opening tag.
  • Hello World! is the content.
  • </p> is the closing tag.

The <p> paragraph element tells the browser that the content inside is "paragraph" text.

Let's take a look at a basic HTML program that displays a message in the browser:

<body><p>👋 I'm a new web developer!</p></body>

The <body> element defines an HTML document's "body" and it's where any content that we want to display to the user will be held:

  • <body> opening tag begins the "body".
  • <p>👋 I'm a new web developer!</p> is some text in a paragraph element.
  • </body> closing tag ends the "body".

Note: There can only be one <body> element in a file.

Indentation

While indenting HTML code isn't required, doing so is good practice because it makes your code easier to read and visualize the nesting levels.

Here's how to indent the previous code block:

<body>
  <p>👋 I'm a new web developer!</p>
</body>

Notice how it's a lot easier to read this way!

We recommend two spaces for indentations.

Instructions

The ancient Greeks believed that there were four elements that everything under the sun was made up of:

  • 🔥 Fire
  • 💧 Water
  • ⛰️ Earth
  • 🌪️ Air

Create an elemental.html file that shows the four elements in the browser.

Make sure that it's indented nicely, too!

Help

Get a Hint

Want the solution? Try completing the lesson first!

New Item Unlocked!

pom pom characters gifitem duck

Rubber Duck NEW

Rubber duck debugging is a classic technique used by developers to debug code. By explaining the code line-by-line to a rubber duck, you can break down the code into smaller pieces, and potentially identify the error.

... It's silly, we know.

New Item Unlocked!

pom pom characters gifitem duck

Codédex BotNEW

I’m a coding mentor bot built with GPT-4 👋. I’m here to answer any questions related to programming, Codédex, and much more.

FEATURE UNLOCKED!

sad characters gif

You have 100 XP! This means you can now join our Discord community to chat and hang out with fellow learners and the team behind Codédex!
See you there. 😊

FEATURE UNLOCKED!

pom pom characters gif

You have 250 XP! This means you can now join our On-Platform community to chat and hang out with fellow learners!
Say hi in the Introductions channel. 😊

ga

Welcome to the General Assembly x Codédex experience!

Complete the following mandatory chapters:
HTML Chapters 1-2, CSS Chapters 1-2, and JavaScript Chapters 1-2.

You will submit the code in the last exercise of each of the chapters:

Once you've completed all of them, you can submit your work
and tell us about your experience!

js logoelemental.html

user image
send image
user image

Hi, I’m Codédex Bot! I’m a coding mentor bot built with GPT-4 👋.

I’m here to answer any questions related to programming, Codédex, and much more.

For example, try to ask something like:

  • What are classes and objects in Python?
  • How to create a table in HTML?
  • What's if (variable > 2) print(‘greater’)?
  • What's Codédex Club?
send image
item duck
Loading...

index.html

Your code results will appear here when you Run the project.

user image
send image
user image

Hi, I’m Codédex Bot! I’m a coding mentor bot built with GPT-4 👋.

I’m here to answer any questions related to programming, Codédex, and much more.

For example, try to ask something like:

  • What are classes and objects in Python?
  • How to create a table in HTML?
  • What's if (variable > 2) print(‘greater’)?
  • What's Codédex Club?
send image

Elements

01. Shooting Star

02. Elemental

03. Newspaper

04. Corporate Talk

05. Sous-Chef

06. Lost Pet

07. Favorite Band

Structure

Forms

Semantic HTML

02. Elemental

10 XP

Others on this exercise:

arpitkumar3347 image

@arpitkumar3347

SINGH ARPIT AJAY

Level 8

gordo32 image

@gordo32

Level 4

carlosfigu77705 image

@carlosfigu77705

Level 4

sawkza image

@sawkza

Ye Htut Oo

Level 3

meilindazz45662 image

@meilindazz45662

Meilinda

Level 3

Adocalypsced image

@Adocalypsced

Ado Tomo jr

Level 3

R4ttiK4tti image

@R4ttiK4tti

Kat Simeonidis

Level 3

HamDy image

@HamDy

Feyisola Akinpelu

Level 3

LuizHenrique image

@LuizHenrique

Level 3

Ferreiraa image

@Ferreiraa

Pedro Ferreira

Level 2

H4CHIBI image

@H4CHIBI

Butil, Vinardo G.

Level 2

SenkuUchiha2x image

@SenkuUchiha2x

Senku Uchiha

Level 2

ashashyan image

@ashashyan

Yanzhuang Tan

Level 2

gomes image

@gomes

Level 2

Khadoche image

@Khadoche

Khadijetou Dia

Level 2

Zmx3yA image

@Zmx3yA

Sahar Abramov

Level 2

JJboy image

@JJboy

Emnica Morison

Level 2

alexchk9975589 image

@alexchk9975589

Alex

Level 2

ALEXIS3434 image

@ALEXIS3434

ALEXIS CASTRO

Level 2

juujuu image

@juujuu

Level 2

chen21 image

@chen21

abd rofii'

Level 1

gostgirl image

@gostgirl

Level 1

Daksh915 image

@Daksh915

Level 1

SabiBina image

@SabiBina

Level 1

ozmosis image

@ozmosis

Lucas Mollerstuen

Level 1

iubi image

@iubi

Gladys Gay Palen

Level 1

fraf image

@fraf

Fancy Spider

Level 1

Odd1y image

@Odd1y

Вадим Чайкін

Level 1

ixl122anil25683 image

@ixl122anil25683

Level 1

TacoFreddy image

@TacoFreddy

James Elderkin

Level 1

ElvisOkami image

@ElvisOkami

Elvis Lupo

Level 1

PooSea image

@PooSea

Level 1

Z-GG3R4 image

@Z-GG3R4

Level 1

Moeketsi image

@Moeketsi

Level 1

ccs5557 image

@ccs5557

CHEN CHANG SOON

Level 1

Bokse image

@Bokse

Prajwal Syangtan

Level 1

Willtan image

@Willtan

weier tan

Level 1

berga image

@berga

Level 1

abcdefghz image

@abcdefghz

Level 1

Silencer8 image

@Silencer8

Level 1

Tx3tureggwp image

@Tx3tureggwp

Hoang

Level 1

Hartpac image

@Hartpac

Miles Armstrong

Level 1

ericzzdd image

@ericzzdd

mingan zheng

Level 1

izaac image

@izaac

Isaac Park

Level 1

kaveena image

@kaveena

Level 1

jack91 image

@jack91

Level 1

XTRM image

@XTRM

Level 1

Ataliya image

@Ataliya

Soha Fatima

Level 1

UcungSunda image

@UcungSunda

Yordan Yohanes

Level 1

viqui image

@viqui

lisaagom 00

Level 1

Sututututu image

@Sututututu

Level 1

Fr0gmaster23123 image

@Fr0gmaster23123

hasin chowdhury

Level 1

masawafy image

@masawafy

Level 1

FHDArnold image

@FHDArnold

Level 1

shrii77 image

@shrii77

Shriya Dinkar

Level 1

ailments image

@ailments

Jiken SN

Level 1

guichosk8 image

@guichosk8

Luis González

Level 1

fr0z3n image

@fr0z3n

Level 1

MaCCori image

@MaCCori

Level 1

Laran36 image

@Laran36

Mario Rossi

Level 1

adhanz image

@adhanz

Level 1

Maleale image

@Maleale

Alejandra Meneses

Level 1

Shaldon image

@Shaldon

Shaldon Soh

Level 1

xNavyT image

@xNavyT

Level 1

emmahellie2421 image

@emmahellie2421

emma

Level 1

danigo image

@danigo

Level 1

cubicie image

@cubicie

Yuxuan Liu

Level 1

Tecko image

@Tecko

Felipe

Level 1

ammutti image

@ammutti

LAQSHYA PRIYA

Level 1

Sacredsoul image

@Sacredsoul

manthan maru (mmaru)

Level 1

sisouh image

@sisouh

Zohra bachir

Level 1

luisjose81475 image

@luisjose81475

José

Level 1

everiwhichwei image

@everiwhichwei

at the moment

Level 1

lukman image

@lukman

Srilakshmi Manuraj

Level 1

ItsMeDAN image

@ItsMeDAN

Level 1

Azab image

@Azab

Mohamed Ahmed

Level 1

St4r3 image

@St4r3

Gisell Espinoza

Level 1

Arsi25 image

@Arsi25

Level 1

allaliAX image

@allaliAX

Level 1

Danny01 image

@Danny01

Level 1

Lyiz image

@Lyiz

Pedro Ferreira

Level 1

Mixtry image

@Mixtry

Soul FaithX

Level 1

Squaredius image

@Squaredius

Level 1

chloe104 image

@chloe104

Level 1

sayyanika image

@sayyanika

Level 1

dimajpeg image

@dimajpeg

Dima Matushenko

Level 1

aditiPaul image

@aditiPaul

Aditi Paul

Level 1

J0hnnyJ0y image

@J0hnnyJ0y

Level 1

rons image

@rons

Level 1

esalhs image

@esalhs

Level 1

be3blebop image

@be3blebop

Level 1

toinou image

@toinou

Antoine Husser

Level 1

Galaxiius image

@Galaxiius

Adailton Vieira

Level 1

hypernova2099 image

@hypernova2099

chrisel edward

Level 1

rohinii image

@rohinii

Rohini Choudhary

Level 1

AgentWindex image

@AgentWindex

Brandon Spencer

Level 1

JustHubaish image

@JustHubaish

Just Hubaish

Level 1

sreelakshmip image

@sreelakshmip

Level 1

Ava-simone image

@Ava-simone

Ava Ferguson

Level 1

Zahil85 image

@Zahil85

Level 1

aidentea image

@aidentea

Level 1

90210 image

@90210

Level 1

JTP image

@JTP

Level 1

Maeny image

@Maeny

Level 1

TI-84 image

@TI-84

JD Zeng

Level 1

Drox image

@Drox

Level 1

wryyyyyyyyyy image

@wryyyyyyyyyy

Level 1

PutMD image

@PutMD

Putera

Level 1

jojoschiiiii image

@jojoschiiiii

joshii *

Level 1

sweetmocha image

@sweetmocha

gabriela mattos

Level 1

Filippp image

@Filippp

Filip Marković

Level 1

hamid1373 image

@hamid1373

h hh

Level 1

rseyfiff77254 image

@rseyfiff77254

r

Level 1

Litte image

@Litte

Eliza Eudoxio

Level 1

Senkuchan image

@Senkuchan

Rafly Al bukhori

Level 1

MuhammadKamran image

@MuhammadKamran

Muhammad Kamran

Level 1

purple98 image

@purple98

Level 1

Syzo image

@Syzo

abode m

Level 1

ProperTouch image

@ProperTouch

Level 1

davidpainart image

@davidpainart

David Pain

Level 1

jinijijin image

@jinijijin

Level 1

vibhutii image

@vibhutii

Vibhuti Gaikwad

Level 1

anak04 image

@anak04

Ana Krivic

Level 1

Emeka01 image

@Emeka01

Level 1

SilvioX image

@SilvioX

Minghua Xiao

Level 1

Honer image

@Honer

Liam Cole

Level 1

moonmiu image

@moonmiu

Chomchanok K (Miu)

Level 1

Kaishi19 image

@Kaishi19

Level 1

Dhruvesh image

@Dhruvesh

Level 1

cvazc image

@cvazc

Sebastián

Level 1

ItzJay image

@ItzJay

Level 1

SoupDumpling image

@SoupDumpling

Level 1

musikian image

@musikian

Level 1

AmanAman image

@AmanAman

Amanuel Gebreslassie

Level 1

wolfgang852022806 image

@wolfgang852022806

Олег

Level 1

max0 image

@max0

Mclance Tan

Level 1

sinenkosi image

@sinenkosi

Sinenkosi Nsele

Level 1

karimee06 image

@karimee06

Karime Garza

Level 1

mcbad image

@mcbad

Level 1

02darling image

@02darling

02 Darling

Level 1

kimberlai image

@kimberlai

Level 1

IMREX56 image

@IMREX56

Somendra Patnaik

Level 1

Steeven image

@Steeven

Jeff HOUNKPE SAGBO

Level 1

elizavetap73308 image

@elizavetap73308

Prigozhaya Liaz

Level 1

hyhihuhi image

@hyhihuhi

Huy Nguyễn

Level 1

exalto image

@exalto

Level 1

kinex image

@kinex

Level 1

raks21 image

@raks21

Rakshitha V

Level 1

imMS image

@imMS

Level 1

PARSHAK image

@PARSHAK

Shukla Parshak

Level 1

Askia image

@Askia

Level 1

Nathanaell image

@Nathanaell

nathan uk

Level 1

ziad1 image

@ziad1

zyad abdelsalam

Level 1

exSwce image

@exSwce

80_Swarnali

Level 1

Kirb03 image

@Kirb03

Sanjith Sahiram

Level 1

Marwae image

@Marwae

Level 1

be4rily image

@be4rily

Lily Luong

Level 1

Jevi image

@Jevi

Jeffrey Johanning

Level 1

Jakeleo image

@Jakeleo

Level 1

Astreed image

@Astreed

Lola Torillec

Level 1

Roster666 image

@Roster666

Thuto Nthutang

Level 1

SAI45 image

@SAI45

SAISH PANCHAL

Level 1

JeziLeBG97 image

@JeziLeBG97

Jezi Jabou

Level 1

Harini05 image

@Harini05

Harini R

Level 1

abcdefghz
ALEXIS3434
Silencer8
Daksh915
Arsi25
+160

02. Elemental

Elements

To understand how HTML works, we need to start with elements – the smallest building blocks of the language.

An element usually consists of an opening tag, the content, and a closing tag. A tag is enclosed in angle brackets.

<p>Hello World!</p>

So this is one HTML element where:

  • <p> is the opening tag.
  • Hello World! is the content.
  • </p> is the closing tag.

The <p> paragraph element tells the browser that the content inside is "paragraph" text.

Let's take a look at a basic HTML program that displays a message in the browser:

<body><p>👋 I'm a new web developer!</p></body>

The <body> element defines an HTML document's "body" and it's where any content that we want to display to the user will be held:

  • <body> opening tag begins the "body".
  • <p>👋 I'm a new web developer!</p> is some text in a paragraph element.
  • </body> closing tag ends the "body".

Note: There can only be one <body> element in a file.

Indentation

While indenting HTML code isn't required, doing so is good practice because it makes your code easier to read and visualize the nesting levels.

Here's how to indent the previous code block:

<body>
  <p>👋 I'm a new web developer!</p>
</body>

Notice how it's a lot easier to read this way!

We recommend two spaces for indentations.

Instructions

The ancient Greeks believed that there were four elements that everything under the sun was made up of:

  • 🔥 Fire
  • 💧 Water
  • ⛰️ Earth
  • 🌪️ Air

Create an elemental.html file that shows the four elements in the browser.

Make sure that it's indented nicely, too!

Help

Get a Hint

FEATURE UNLOCKED!

sad characters gif

You have 100 XP! This means you can now join our Discord community to chat and hang out with fellow learners and the team behind Codédex!
See you there. 😊

FEATURE UNLOCKED!

pom pom characters gif

You have 250 XP! This means you can now join our On-Platform community to chat and hang out with fellow learners!
Say hi in the Introductions channel. 😊

js logo

user image
send image
user image

Hi, I’m Codédex Bot! I’m a coding mentor bot built with GPT-4 👋.

I’m here to answer any questions related to programming, Codédex, and much more.

For example, try to ask something like:

  • What are classes and objects in Python?
  • How to create a table in HTML?
  • What's if (variable > 2) print(‘greater’)?
  • What's Codédex Club?
send image
item duck
Loading...

index.html

user image
send image
user image

Hi, I’m Codédex Bot! I’m a coding mentor bot built with GPT-4 👋.

I’m here to answer any questions related to programming, Codédex, and much more.

For example, try to ask something like:

  • What are classes and objects in Python?
  • How to create a table in HTML?
  • What's if (variable > 2) print(‘greater’)?
  • What's Codédex Club?
send image