Interactive online courses HTML Academy
2026-03-09 14:11 Diff

In the current assignment we will assign styles to the <pre> block with the child element <code>. You will only need to uncomment the blocks with code in these assignments. But let’s take a closer look at what exactly we are uncommenting.

Let’s look at the first assignment.

The first rule for pre and code that we are uncommenting is responsible for assigning the text color (color) and background color (background-color). We found out about these properties in one of the previous assignments.

Next we will cover the border and border-radius properties. We have already tried working with these properties a little, so you already know them.

The only other property in the first uncommented rule is font-family. Do you recall that we talked about monospace fonts in the assignment about font-family? We have used this font family here. A monospaced font is one in which all characters occupy the same amount of space. This was the type of font that was once used in typewriters, but now it is popular in code editors. Even right now you are entering text in a monospace font in the code editor that you are using to complete the assignment.

OK, let’s continue. The following are separate rules for pre and code, which are used to set the padding. You are also already familiar with them.

Proceed to the second assignment.

As you will see after completing the first assignment, “extra” properties were applied to the <code> block inside <pre>. Let’s redefine them according to a cascade.