It is said that everything in CSS is a box, but also the text?
If possible also give me official specifications for consultation.
Some properties are for inline content, so I want to know what type of content the text is.
For example:
https://developer.mozilla.org/en-US/docs/Web/CSS/vertical-align
The vertical-align CSS property sets vertical alignment of an inline,
inline-block or table-cell box.
2
Answers
Everything is a box in css. It’s the way the box reacts that is to be set with the display property.
https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/The_box_model
CSS 2 described Text as always being contained in an inline box, an anonymous one if necessary.
However, CSS3 Display describes things differently. It says that text runs are not boxes, but a different kind of object in the box tree.:
It should be noted that in the CSS3 scheme, text is inline content, even though it is not a box.
The precise details of how inline boxes and text runs are laid out can be found in the Inline Layout Model. Note in particular that all the inline boxes and text runs in a block container are wrapped in a single inline box called the root inline box.
The description of vertical alignment is given in Transverse Box Alignment: the vertical-align property