Interactive online courses HTML Academy
2026-03-09 10:53 Diff

In the previous assignment, we listed the main inheritable properties. But not all properties can be inherited. The main non-inheritable properties are the parameters for positioning, sizes, margins, backgrounds, and frames:

background, border, padding, margin, width, height, position, and others.

They are not inherited due to considerations of common sense. For example, if an internal margin is set for a particular block, there is no need to automatically set this margin for each nested element. These parameters are most often unique for each separate block.

Let’s look at what would happen if all of the properties were inherited at once. So, for example, this is how the nav tag would look on the main page if we added a border to it (by using the border property):

Now take the same border property and ensure that it is not inherited.