How does the flex of CSS change the height according to the content
This article mainly explains "how to change the height of CSS's flex according to the content". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how the flex of CSS changes the height according to the content.
One attribute that can achieve a high degree of change is that the part to be applied by align-items:baseline; is to specify the parent element of display:flex
Let's look at a concrete example.
The code is as follows:
HTML
Text content
Text content Text content text
Text content
Text content
Text content
CSS
.container {
Display:flex
Background:#ccc
Flex-wrap:wrap
Align-items:baseline
}
.box {
Width:200px
Margin:10px
Background-color:#66b6d5
}
At this point, I believe you have a deeper understanding of "how the flex of CSS changes height according to the content". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!