Flex is a layout method introduced in CSS3. It can control the arrangement and alignment of elements very flexibly and efficiently. Most people call it elastic. Layout.
2. How to use flex?
Any container can be designated as flex layout
1 #box {
2 display:flex;
3 }
Copy after login
3. The basics of flex Terminology
Elements that use flex layout are called flex containers (flex containers), its child elements are flex elements (flex items).
The flex container contains two mutually perpendicular axes, namely the main axis ( main axis) and secondary axis (cross axis).
The flex element moves along the main axis from main start(main start) to Main end(main end)Arranged in sequence.
If the flex container contains multiple rows of flex elements, then flex lines(flex lines) Arrange them sequentially along the secondary axis from cross start(cross start) to cross end(cross end).
Single flex elements The main axis space occupied is called main axis length (main size), and the secondary axis space occupied is called secondary axis length (cross size).
4. There are six attributes set on the parent container to control the display mode of child elements:
The above is the detailed content of css3 flexible box model flex knowledge. For more information, please follow other related articles on the PHP Chinese website!
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn