CSS colours
Section 2: CSS: the page's lookLesson 2.1 · ⏱ 7 min
In CSS we choose the element, then write its properties between { }: color is the colour of the words, background the background, and font-size the size of the letters. Every line ends with ;.
HTML
<h1>Robo Egypt</h1>
<p>Coding and robotics academy</p>
CSS
body { font-family: Tahoma; text-align: center; }
h1 {
color: #5B3DF5;
font-size: 48px;
}
🖥️ The page in Robo Web:

📌 Another example: colours and text in the middle
We colour the background and the title, and put the words in the middle.
HTML
<h1>Hello!</h1>
<p>This is my colourful page.</p>
CSS
body {
font-family: Tahoma, sans-serif;
background: #FFF4C2;
text-align: center;
}
h1 { color: #E5484D; font-size: 48px; }
p { color: #1B2350; }
🖥️ The page in Robo Web:

✍️ Practise
Colour the title.
✍️ Practise here in the lesson✖ Close the labor open the lab in a new page ↗
🎯 Challenge yourself
Easy
Make the title green.
👀 Show the solution🙈 Hide the solution
HTML
<h1>Green</h1>
CSS
h1 { color: green; }
🖥️ The page in Robo Web:

Result: a green title.
Medium
The page background is light blue, and every paragraph is size 22px.
👀 Show the solution🙈 Hide the solution
HTML
<p>Paragraph 1</p>
<p>Paragraph 2</p>
CSS
body { background: lightblue; }
p { font-size: 22px; }
🖥️ The page in Robo Web:

Result: a blue background and bigger words.
Hard
Two paragraphs: each has a class and a different colour.
👀 Show the solution🙈 Hide the solution
HTML
<p class="hot">Summer is hot ☀️</p>
<p class="cold">Winter is cold ❄️</p>
CSS
.hot { color: orangered; }
.cold { color: steelblue; }
🖥️ The page in Robo Web:

Result: an orange paragraph and a blue paragraph.

