
Classification of HTML elements and DOM tree
Before going into the details of the CSS language, it is necessary to dwell on some key concepts related to HTML. These are preparatory topics for a better understanding of how CSS works. We will start with the classification of HTML elements, and then explain the configuration of the tree structure of a document. Block elements and inline elements We look at an HTML page trying not to think about the content but only about its structure and putting in place a sort of process of abstraction. We can be helped by a simple image: An HTML page rendered on screen by a browser is composed, in fact, of a set of rectangles (boxes). It doesn't matter whether it's paragraphs, titles, tables or images: it's always a rectangular box. Looking…