انتقل للمحتوى
Robo EgyptRobo Egypt
☰ Course contents
Robo Web: home
0. Lab tour1
1. HTML: the page's content7
2. CSS: the page's look6
3. JavaScript: the actions7
4. The project: the to-do list3
5. Pro CSS: shadows and movement5
6. Arrays and building the page with code3
7. Events and forms3
8. Objects and time3
9. Canvas: drawing and games3
10. The final project: the memory game3

Lists

Section 1: HTML: the page's contentLesson 1.3 · ⏱ 6 min

<ul> is a list with dots, and every item in it is <li>.

HTML
<h1>My favourite food</h1>
<ul>
  <li>Koshari</li>
  <li>Pizza</li>
  <li>Mango</li>
</ul>
CSS
body { font-family: Tahoma; }
🖥️ The page in Robo Web:The page in Robo Web

📌 Another example: a list inside a list

A numbered list of steps, and inside one step a list with dots.

🌐 A list inside a list
HTML
<h2>We make juice</h2>
<ol>
  <li>Wash the fruit</li>
  <li>Cut it:
    <ul>
      <li>Banana</li>
      <li>Strawberry</li>
    </ul>
  </li>
  <li>Mix it in the blender</li>
</ol>
CSS
body { font-family: Tahoma, sans-serif; }
🖥️ The page in Robo Web:The page in Robo Web
✍️ Practise
Lists.
✍️ Practise here in the lessonor open the lab in a new page ↗

🎯 Challenge yourself

Easy

A ul list with 3 colours.

👀 Show the solution
🌐 Solution
HTML
<ul>
  <li>Red</li>
  <li>Green</li>
  <li>Blue</li>
</ul>
CSS
body { font-family: Tahoma, sans-serif; }
🖥️ The page in Robo Web:The page in Robo Web

Result: three dots.

Medium

An ol numbered list with five steps for waking up.

👀 Show the solution
🌐 Solution
HTML
<ol>
  <li>I wake up</li>
  <li>I wash my face</li>
  <li>I have breakfast</li>
  <li>I get dressed</li>
  <li>I go to school</li>
</ol>
CSS
body { font-family: Tahoma, sans-serif; }
🖥️ The page in Robo Web:The page in Robo Web

Result: five steps numbered 1 to 5.

Hard

A list in two parts: “Animals” and “Birds”, with a list under each part.

👀 Show the solution
🌐 Solution
HTML
<ul>
  <li>Animals
    <ul><li>Lion</li><li>Elephant</li></ul>
  </li>
  <li>Birds
    <ul><li>Eagle</li><li>Duck</li></ul>
  </li>
</ul>
CSS
body { font-family: Tahoma, sans-serif; }
🖥️ The page in Robo Web:The page in Robo Web

Result: two parts, with two under each.

Finished the lesson? Mark it so your progress counts.