当前位置:网站首页>Flexbox flex property
Flexbox flex property
2022-08-02 03:16:00 【Dummerd】
flex (flexible box, telescopic box)
-is another layout method in css, it is mainly used to replace the floating to complete the layout of the page
-flex can make elements flexible, allowing elements to change according to the size of the page
-flex container
- To use a flex box, an element must first be set as a flex container
-Set the elastic container through display
Display:flex sets a block-level flex container
Set display:inline-flex as an inline flex container
- elastic element
- the direct child of the flex container is the flex element (flex item)
Note: An element can be both a flex container and a flex element at the same time
One: Properties of Elastic Containers
1:flex-direction 2:flex-wrap
3:flex-flow 4:justify-content
5:align-items 6:align-content
1:flex-direction: ; specifies the arrangement of flex elements in the container
Optional values:
The default value of row, the flex elements are arranged horizontally in the container (left to right)
Main axis - left to right
Row-reverse Elastic elements are arranged horizontally in reverse (right to left) in the container
Main axis - right to left
The column elastic elements are arranged vertically (from top to bottom)
Main axis - top to bottom
Column-reverse elastic elements are arranged vertically (from bottom to top)
Main axis - bottom to top
Main axis: The arrangement direction of elastic elements is called the main axis
Side axis: the direction perpendicular to the main axis is called the side axis
2: flex-wrap: ;Set whether the flex element wraps automatically in the flex container
Optional values:
The default value of nowrap, the element will not wrap automatically
wrap element automatically wraps along the minor axis
wrap-reverse element wraps in the opposite direction of the minor axis
3:flex-flow: Shorthand properties for wrap and direction, and no ordering requirements
Default row nowrap
4:justify-content How to allocate empty space on the main axis (how the elements on the main axis are arranged)
Optional values:
flex-start elements are aligned along the main axis starting edge
flex-end elements are aligned along the end of the main axis
The center element is centered
Space-around whitespace is distributed to both sides of the element
Space-between whitespace evenly distributed between elements
Space-evenly whitespace is distributed to one side of the element (less compatibility)
5: align-items How to align on the secondary axis - the relationship between elements
Optional values:
The default value of stretch is to set the length of elements on the same line to the same value
The flex-start element does not stretch and is aligned along the minor axis
The flex-end element does not stretch and is aligned along the end edge of the minor axis
align center center
baseline baseline alignment (incorrect use)
6: align-content: ;Distribution of blank space on secondary axis
Optional values:
flex-start elements are aligned along the minor axis
flex-end elements are aligned along the end of the minor axis
The center element is centered
Space-around whitespace is distributed to both sides of the element
Space-between whitespace evenly distributed between elements
Space-evenly whitespace is distributed to one side of the element (less compatible)
边栏推荐
- JDBC--Druid数据库连接池以及Template基本用法
- Istio微服务治理网格的全方面可视化监控(微服务架构展示、资源监控、流量监控、链路监控)
- Heuristic merge, DSU on Tree
- 【LeetCode】104. Maximum depth of binary tree
- Go语学习笔记 - gorm使用 - gorm处理错误 Web框架Gin(十)
- iVX低代码平台系列详解 -- 概述篇(二)
- 脚手架安装
- 面试必备!TCP协议经典十五连问!
- Good Key, Bad Key (思维,临项交换,经典方法)
- 01-Node-Express系统框架搭建(express-generator)
猜你喜欢
随机推荐
MySQL8--Windows下使用压缩包安装的方法
两对象数组比较拿出不同值方法
Istio微服务治理网格的全方面可视化监控(微服务架构展示、资源监控、流量监控、链路监控)
7-36 社交网络图中结点的“重要性”计算 (30 分) 不用迪杰斯特拉也不用弗洛伊德
ASP WebShell 后门脚本与免杀
TRICK第二弹
咨询cdc for oracle,增量同步scan.startup.mode只有initial和la
[LeetCode] 83. Delete duplicate elements in the sorted list
IPIDEA的使用方式
MySQL八股文背诵版
Keil开发环境安装教程
“带薪划水”偷刷阿里老哥的面经宝典,三次挑战字节,终成正果
Chapter 10 聚类
知识体系树
给你一个大厂面试的机会,你能面试上吗?进来看看!
黑马案例--实现 clock 时钟的web服务器
常见的SQL面试题:经典50例
VPS8504C 微功率隔离电源隔离芯片 VPSC源特科技
PHP WebShell 免杀
MySQL中的时间函数









