🙅🏾♂️ Flexbox Sem Frescura
**目录**
CSS Flexbox 简介
什么是 Flexbox?
有什么好处?
布局模型
Flexbox 的优点
术语
弹性容器
弹性项目
柔性线
方向和尺寸
显示类型 flex: display: flex; 和 display: inline-flex;
简介
显示之间的差异:flex; e 显示:inline-flex;
乌索
/*Modulo 1/3 display-flex inline-flex/3-display-flex-inline-flex.html*/ .wrraper{ padding: 1%; margin-top: 1em; } .container-flex, .container-inline-flex{ background-color: #85d0bc; border: 1px solid #028082; width: 30%; padding: 1%; margin: 0 auto; color: #028082; } .container-flex{ display: flex; } .container-inline-flex{ display: inline-flex; background-color: #d0b285; border: 1px solid #822b02; }

🔗 **资源**:https://github.com/mrpunkdasilva/CSS-Flex-Box/blob/master/Modulo%201/3%20display-flex%20inline-flex/3-display-flex-inline-flex.html
弹性方向
**Flex Direction** 是 CSS 的属性,它定义了容器 Flexível 的主要方向。存在两个主要原则,即容器的具体组成部分。任何主要的改变,都可以改变为灵活的属性。
总公司性质:
逆向方向属性:
乌索
/* Modulo 1/4 flex direction/flex-direction.html */ .direction-row, .direction-column{ display: flex; background-color: #85d0bc; border: 1px solid #028082; width: 30%; padding: 1%; margin: 0 auto; color: #028082; } .direction-column{ flex-direction: column; margin-bottom: 2em; } .direction-row{ flex-direction: row; }

🔗 **资源**:https://github.com/mrpunkdasilva/CSS-Flex-Box/blob/master/Modulo%201/4%20flex%20direction/flex-direction.html
柔性包装
**flex-wrap** 是 CSS 的专有技术,它定义了容器的弹性容器的“quebrar”,它是新的链接或全部的空间或足够的空间。它阻碍了容器的扩展或改变,允许以灵活的方式重组。
Flex Wrap 的特性:
**注意**:Se os itens não couberem, o conteúdo transbordará do container flexível。
**观察**:“包裹”和使用的原则是水平方向,其方向是水平方向。垂直方向上的每个季节,垂直方向上的方向。
乌索
/* Modulo 1/5 flex-wrap/flex-wrap.html */ .container { display: flex; background-color: #85d0bc; border: 1px solid #028082; flex-direction: row; width: 30%; height: 600px; padding: 1%; margin: 0 auto; color: #028082; } .item { background-color: #cdf6eb; border: 1px solid #028082; width: 100px; height: 200px; }

🔗 **资源**:https://github.com/mrpunkdasilva/CSS-Flex-Box/blob/master/Modulo%201/5%20%20flex-wrap/flex-wrap.html
调整内容
O **justify-content** 是 CSS 的专有属性,它是容器弹性的核心,也是主要的。在其他情况下,需要使用 **flex-wrap** 与水平方向的移动(或垂直方向相关)相结合。
值:
**注意**:“flex-direction”定义为“column”,是“justify-content”的方向,主要是垂直方向,“row”方向和水平方向。
乌索
/* Modulo 1/6 justify-content/justify-content.html */ .container { display: flex; background-color: #85d0bc; border: 1px solid #028082; flex-direction: row; flex-wrap: wrap; justify-content: space-between; width: 30%; height: 600px; margin: 0 auto; color: #028082; } .item { background-color: #cdf6eb; border: 1px solid #028082; width: 100px; height: 200px; }

🔗 **资源**:https://github.com/mrpunkdasilva/CSS-Flex-Box/blob/master/Modulo%201/6%20%20justify-content/justify-content.html
对齐项目
CSS 的属性 **align-items** 与 alinhar 的响应一起,使容器的弹性不横向,或者不垂直,不垂直方向 **flex-direction** 设置为“行”(水平)配置,不设置水平方向 o **flex-direction** 设置为“列”配置 (垂直的)。
值:
乌索
/* Modulo 1/7 align-items/align-items.html */ .container { display: flex; background-color: #85d0bc; border: 1px solid #028082; flex-direction: row; flex-wrap: nowrap; justify-content: center; align-items: baseline; width: 30%; height: 600px; margin: 0 auto; color: #028082; } .item { background-color: #cdf6eb; border: 1px solid #028082; width: 100px; height: 70px; }

🔗 **资源**:https://github.com/mrpunkdasilva/CSS-Flex-Box/blob/master/Modulo%201/7%20%20align-items/align-items.html
弹性成长
**flex-grow** 属性定义了容器弹性增长的因素。 Seu valor padrão é 0,对于padrão来说意义重大,os itens não crescem para ocupar o espaço disponível。 O **flex-grow** recebe apenas valores numéricos。
功能介绍:
使用连续公式计算渐进的因素:
计算方法是一种渐进式的计算方法,它是一种灵活的弹性体,可以在没有容器的情况下扩展预置空间。
乌索
/* Modulo 1/9 flex-grow/flex-grow.html */ .container { display: flex; background-color: #85d0bc; border: 1px solid #028082; width: 1000px; height: 400px; margin: 0 auto; color: #028082; } .item { background-color: #cdf6eb; width: 150px; height: 70px; display: flex; justify-content: center; align-items: center; } .item:nth-child(even) { background-color: #a4ddce; } .item:nth-child(2){ flex-grow: 4; }

🔗 **资源**:https://github.com/mrpunkdasilva/CSS-Flex-Box/blob/master/Modulo%201/9%20%20flex-grow/flex-grow.html
柔性收缩
**弹性收缩**是**弹性增长**的反面,决定了容器的弹性。 Seu valor padrão é 1,对于 padrão 来说意义重大,os itens podem encolher até largura do flex-container,se necessário。
功能介绍:
使用 **flex-grow** 的 mesma 公式进行计算:
一个统一的应用程序可用于调整容器布局的比例。
乌索
/* Modulo 1/10 flex-shrink/flex-shrink.html */ .container { display: flex; background-color: #85d0bc; border: 1px solid #028082; width: 500px; height: 400px; margin: 0 auto; color: #028082; } .item { background-color: #cdf6eb; width: 200px; height: 70px; display: flex; justify-content: center; align-items: center; } .item:nth-child(even) { background-color: #a4ddce; flex-shrink: 6; }

🔗 **资源**:https://github.com/mrpunkdasilva/CSS-Flex-Box/blob/master/Modulo%201/10%20%20flex-shrink/flex-shrink.html
弹性基础
属性**弹性基础**定义了弹性项目的初始尺寸,它是一个较大的或一个较高的值,依赖于不同的方向。 Quando a direção do eixo está na Horizontal, adimensão alterada é alargura;它是垂直的,是一个不同的尺寸。
詳細信息:
乌索
flex-basis-largura-altura
/* Modulo 1/11 flex-basis/11.1 flex-basis-largura-altura/flex-basis-largura-altura.html */ .container { display: flex; background-color: #85d0bc; border: 1px solid #028082; width: 550px; height: 400px; margin: 0 auto; color: #028082; overflow: hidden; border-radius: 12%; } .item { display: flex; justify-content: center; align-items: center; background-color: #cdf6eb; box-shadow: 0 0 12rem #fff; height: 150px; border-radius: 5%; margin-top: 20%; margin-right: 4px; flex-basis: 250px; flex-shrink: 0; animation: rotateItem 6s infinite; }

flex-basis-auto
/* Modulo 1/11 flex-basis/11.2 flex-basis-auto/flex-basis-auto.html */ .container { display: flex; flex-direction: column; background-color: #85d0bc; border: 1px solid #028082; width: 500px; height: 400px; margin: 0 auto; color: #028082; } .item { background-color: #cdf6eb; height: 70px; display: flex; justify-content: center; align-items: center; flex-basis: auto; } .item:nth-child(even) { flex-grow: 1; background-color: #a4ddce; }

🔗 **资源**:https://github.com/mrpunkdasilva/CSS-Flex-Box/tree/master/Modulo%201/11%20flex-basis
flex-basis-zero
/* Modulo 1/11 flex-basis/11.3 flex-basis-zero/flex-basis-zero.html */ .container { display: flex; background-color: #85d0bc; border: 1px solid #028082; width: 500px; height: 400px; margin: 0 auto; color: #028082; } .item { background-color: #cdf6eb; height: 70px; display: flex; justify-content: center; align-items: center; flex-grow: 1; } .item:nth-child(even) { background-color: #a4ddce; }
flex-basis-conteúdo-maior
/* Modulo 1/11 flex-basis/11.4 flex-basis-conteúdo-maior/flex-basis-conteúdo-maior.html */ .container { display: flex; background-color: #85d0bc; border: 1px solid #028082; width: 1000px; height: 400px; margin: 0 auto; color: #028082; } .item { background-color: #cdf6eb; height: 70px; display: flex; justify-content: center; align-items: center; text-align: center; flex-basis: 1200px; } .item:nth-child(even) { background-color: #a4ddce; } .item:nth-child(1) { flex-basis: auto; }

弹性基础连续宽度高度
/* Modulo 1/11 flex-basis/11.5 flex-basis-conteúdo-width-height/flex-basis-conteúdo-width-height.html */ .container { display: flex; background-color: #85d0bc; border: 1px solid #028082; width: 500px; height: 400px; margin: 0 auto; color: #028082; flex-direction: row; } .item { background-color: #cdf6eb; height: 70px; width: 100px; display: flex; justify-content: center; align-items: center; text-align: center; flex-basis: 200px; } .item:nth-child(even) { background-color: #a4ddce; }

flex-basis-min-width
/* Modulo 1/11 flex-basis/11.6 flex-basis-min-width/flex-basis-min-width.html */ .container { display: flex; background-color: #85d0bc; border: 1px solid #028082; width: 500px; height: 400px; margin: 0 auto; color: #028082; } .item { background-color: #cdf6eb; height: 70px; display: flex; justify-content: center; align-items: center; text-align: center; flex-basis: 90px; min-width: 100px; flex-grow: 0; } .item:nth-child(even) { background-color: #a4ddce; }
flex-basis-max-width
/* Modulo 1/11 flex-basis/11.7 flex-basis-max-width/flex-basis-max-width.html */ .container { display: flex; background-color: #85d0bc; border: 1px solid #028082; width: 600px; height: 400px; margin: 0 auto; color: #028082; } .item { background-color: #cdf6eb; height: 70px; display: flex; justify-content: center; align-items: center; text-align: center; flex-basis: 30%; flex-shrink: 0; } .item:nth-child(even) { background-color: #a4ddce; }

flex-basis-wrap
/* Modulo 1/11 flex-basis/11.8 flex-basis-wrap/flex-basis-wrap.html */ .container { display: flex; background-color: #85d0bc; border: 1px solid #028082; width: 400px; height: 160px; margin: 0 auto; color: #028082; flex-wrap: wrap; } .item { background-color: #cdf6eb; height: 70px; display: flex; justify-content: center; align-items: center; flex-basis: 200px; flex-grow: 1 } background-color: #a4ddce; .item:nth-child(even) { }

🔗 **主题示例资源**:https://github.com/mrpunkdasilva/CSS-Flex-Box/tree/master/Modulo%201/11%20flex-basis
灵活产权
**flex** 的属性是 Flexbox 属性声明的简化形式,例如 **flex-grow**、**flex-shrink** 和 **flex-basis**。 Ela 组合为 três em uma única declaração。
值得珍惜:
语法:
詳細信息:
Flexbox 的使用非常简单,允许声明共同财产的契约,并具有独特的勇气。
乌索
flex-valor-padrão
/* Modulo 1/12 flex/12.1 flex-valor-padrão/flex-valor-padrão.html */ .container { display: flex; background-color: #85d0bc; border: 1px solid #028082; width: 500px; height: 400px; margin: 0 auto; color: #028082; } .item { background-color: #cdf6eb; height: 70px; display: flex; justify-content: center; align-items: center; flex: 0 2 100px; }
屈-勇-屈-不屈
/* Modulo 1/12 flex/12.2 flex-valor-flexivel-inflexivel/flex-valor-flexivel-inflexivel.html */ .container { display: flex; background-color: #85d0bc; border: 1px solid #028082; width: 500px; height: 400px; margin: 0 auto; color: #028082; } .item { background-color: #cdf6eb; height: 70px; display: flex; justify-content: center; align-items: center; flex: auto; }

弹性值零
/* Modulo 1/12 flex/12.3 flex-valor-zero/flex-valor-zero.html */ .container { display: flex; background-color: #85d0bc; border: 1px solid #028082; width: 500px; height: 400px; margin: 0 auto; color: #028082; } .item { background-color: #cdf6eb; height: 70px; display: flex; justify-content: center; align-items: center; flex: 1; } .item:nth-child(even) { background-color: #a4ddce; } .item:nth-child(3) { flex: 2; } .item:nth-child(4) { flex: 0; }

🔗 **资源**:https://github.com/mrpunkdasilva/CSS-Flex-Box/blob/master/Modulo%201/12%20flex/
所有权令
属性**顺序**定义了元素的顺序(它是灵活的),但不能改变 HTML 的顺序。 Ela afeta apenas 是视觉元素的配置。
詳細信息:
订购规则:
乌索
/* Modulo 1/13 order/order.html */ .item { background-color: #cdf6eb; display: flex; justify-content: center; align-items: center; text-align: center; flex: 1 1 auto; margin: 4px 8px; } .order_menosUm { order: -1; } .order { order: 0; } .order_1 { order: 1; } .order_2 { order: 2; } .order_3 { order: 3; }

🔗 **资源**:https://github.com/mrpunkdasilva/CSS-Flex-Box/blob/master/Modulo%201/13%20order/order.html
自我对齐
**自我对齐**属性允许改变容器中的弹性物品的排列方式,以形成**对齐物品**的功能,并可以使用特定物品。
值得珍惜:
值:
乌索
对齐自身 eixo 主体
/* Modulo 1/14 align-self/14.1 align-self-eixo-principal/align-self-eixo-principal.html */ .item { background-color: #cdf6eb; display: flex; justify-content: center; align-items: center; text-align: center; flex: 1 1 auto; } .item:nth-child(even) { background-color: #a4ddce; } .stretch { align-self: stretch; } .flex-start{ align-self: flex-start; } .flex-end{ align-self: flex-end; } .center{ align-self: center; } .baseline{ align-self: baseline; font-size: 5em; } .baseline-2{ align-self: baseline; }

对齐自身 eixo 横向
/* Modulo 1/14 align-self/14.2 align-self-eixo-transversal/align-self-eixo-transversal.html */ .item { background-color: #cdf6eb; display: flex; justify-content: center; align-items: center; text-align: center; flex: 1 1 auto; } .item:nth-child(even) { background-color: #a4ddce; } .stretch { align-self: stretch; } .flex-start { align-self: flex-start; } .flex-end { align-self: flex-end; } .center { align-self: center; } .baseline { align-self: baseline; }
🔗 **主题示例的资源**:https://github.com/mrpunkdasilva/CSS-Flex-Box/tree/master/Modulo%201/14%20align-self
作者注
如果您想使用“colinha”,请使用正常的名称或功能,以实现我们的目标。

Alguns 游戏与实践和 aprender 弹性盒:
官方文档、相关信息和互联网声音:https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/CSS_layout/Flexbox

可以在水平方向上与布局网格的链接进行布局,使用的布局模型的原理是: