What is the difference between a block block and a level block of a main block?

To list the specification :

Block levels are blocks that are involved in formatting context blocks. Each element of the block level generates a main block level that contains stream boxes and generated content, as well as the field used in any positioning scheme. Some block level elements may create additional fields in addition to the main block: Elements of the list of elements. These additional boxes are placed respectfully in the main unit.

Are they basically the same?

+5
source share
2 answers

The main block-block-block is a block level created by this element, which directly depends on the style rules that apply to the element.

Most elements generate only one field. For these elements, they are essentially the same thing, since there are no other boxes.

However, an item can generate more than one window depending on its display type, for example, a list item ; when you declare styles for such an element, styles are usually applied to the main block, and any additional fields that are generated will be displayed accordingly.

For example, a list item has a marker field in addition to the main block; if you specify list-style-position: outside , the list marker will be placed outside the main field, but the background and borders of the main block will not be affected. Please note that the marker field is still a descendant of the main block, therefore inherited properties such as color will be applied to the marker (therefore color: red displays both the text and the marker marker red).

Most other block-level elements, including display: block , but excluding display: table (see section 17.4 ), will simply generate a main block for their contents and nothing else, which makes them essentially just “block blocks”, but only for these elements .

In other words, all the basic blocks of the block level are block blocks, but not all blocks of the block level are the main ones, for example, anonymous block blocks . In addition, inline elements, including inline blocks, themselves do not generate any main drawers, and there is no such thing as a main inline block.

+9
source

The main unit is, in fact, what your “markup” is, for mechanical purposes, some “basic” elements need other elements that need to be rendered correctly, these are some kind of “artifacts” that the browser needs to display the excess (scroll a bar from a text box, for example)

0
source

All Articles