aboutsummaryrefslogtreecommitdiff
path: root/files/pt-br/web/css/grid-auto-flow/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/pt-br/web/css/grid-auto-flow/index.html')
-rw-r--r--files/pt-br/web/css/grid-auto-flow/index.html207
1 files changed, 207 insertions, 0 deletions
diff --git a/files/pt-br/web/css/grid-auto-flow/index.html b/files/pt-br/web/css/grid-auto-flow/index.html
new file mode 100644
index 0000000000..ae212a18a6
--- /dev/null
+++ b/files/pt-br/web/css/grid-auto-flow/index.html
@@ -0,0 +1,207 @@
+---
+title: grid-auto-flow
+slug: Web/CSS/grid-auto-flow
+tags:
+ - pt-br
+translation_of: Web/CSS/grid-auto-flow
+---
+<p>A propriedade de CSS <strong><code>grid-auto-flow </code></strong> controla como o algoritmo de arrumação automática funciona, especificando exatamente como os itens fluirão no grid.</p>
+
+<pre class="brush: css no-line-numbers">/* Keywords Chaves */
+grid-auto-flow: row;
+grid-auto-flow: column;
+grid-auto-flow: dense;
+grid-auto-flow: row dense;
+grid-auto-flow: column dense;
+
+/* Valores globais */
+grid-auto-flow: inherit;
+grid-auto-flow: initial;
+grid-auto-flow: unset;
+</pre>
+
+<p>{{cssinfo}}</p>
+
+<h2 id="Syntaxe">Syntaxe</h2>
+
+<p>Esta propriedade pode ser de duas maneiras:</p>
+
+<ul>
+ <li>uma única keyword (palavra-chave):  <code>row(linha)</code>, <code>column</code>(coluna), ou <code>dense(denso)</code>.</li>
+ <li>duas keywords (palavras-chave): <code>row dense(linha densa)</code> ou <code>column dense(coluna densa)</code>.</li>
+</ul>
+
+<h3 id="Valores">Valores</h3>
+
+<dl>
+ <dt><code>row (linha)</code></dt>
+ <dd>Keyword (palavra-chave) que determina que o algoritmo de arrumação automática coloca os itens preenchendo cada linha de uma vez, adicionando novas linhas se necessário. Se nem <code>row</code>(linha) ou <code>column(coluna) </code>for especificado, <code>row (linha)</code> é assumido.</dd>
+ <dt><code>column (coluna)</code></dt>
+ <dd>É uma keyword (palavra-chave) que determina que o algoritmo de arrumação automática coloque os itens preenchendo colunas, adicionando novas se necessário.</dd>
+</dl>
+
+<dl>
+ <dt><code>dense (denso)</code></dt>
+ <dd>Keyword (palavra-chave) que determina que o algoritmo de arrumação automática use um formato de compactação "denso", que tenta preencher os espaços anteriores do grid caso receba itens menores após. Isto talvez deixe os itens fora de ordem, preenchendo espaços deixados por itens maiores.</dd>
+ <dd>Se omitido, o algoritmo "esparso" é utilizado, onde o algoritmo de arrumação somente "avança" no grid ao colocar os itens, nunca voltando para preencher os espaços. Isso garante que todos os itens colocados automaticamente apareçam "em ordem", mesmo que deixem espaçs que poderiam ser preenchidos por itens posteriores.</dd>
+</dl>
+
+<h3 id="Sintaxe_Formal">Sintaxe Formal</h3>
+
+<pre class="syntaxbox">{{csssyntax}}</pre>
+
+<h2 id="Exemplo">Exemplo</h2>
+
+<h3 id="Conteúdo_HTML">Conteúdo HTML</h3>
+
+<pre class="brush: html">&lt;div id="grid"&gt;
+  &lt;div id="item1"&gt;&lt;/div&gt;
+  &lt;div id="item2"&gt;&lt;/div&gt;
+  &lt;div id="item3"&gt;&lt;/div&gt;
+  &lt;div id="item4"&gt;&lt;/div&gt;
+  &lt;div id="item5"&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;select id="direction" onchange="changeGridAutoFlow()"&gt;
+  &lt;option value="column"&gt;column&lt;/option&gt;
+  &lt;option value="row"&gt;row&lt;/option&gt;
+&lt;/select&gt;
+&lt;input id="dense" type="checkbox" onchange="changeGridAutoFlow()"&gt;
+&lt;label for="dense"&gt;dense&lt;/label&gt;
+</pre>
+
+<h3 id="Conteúdo_CSS">Conteúdo CSS</h3>
+
+<pre class="brush: css; highlight[7]">#grid {
+ height: 200px;
+ width: 200px;
+ display: grid;
+ grid-gap: 10px;
+ grid-template: repeat(4, 1fr) / repeat(2, 1fr);
+ grid-auto-flow: column; /* or 'row', 'row dense', 'column dense' */
+}
+
+#item1 {
+ background-color: lime;
+ grid-row-start: 3;
+}
+
+#item2 {
+ background-color: yellow;
+}
+
+#item3 {
+ background-color: blue;
+}
+
+#item4 {
+ grid-column-start: 2;
+ background-color: red;
+}
+
+#item5 {
+ background-color: aqua;
+}</pre>
+
+<pre class="brush: js; hidden">function changeGridAutoFlow() {
+ var grid = document.getElementById("grid");
+ var direction = document.getElementById("direction");
+ var dense = document.getElementById("dense");
+ var gridAutoFlow = direction.value === "row" ? "row" : "column";
+
+ if (dense.checked) {
+ gridAutoFlow += " dense";
+ }
+
+ grid.style.gridAutoFlow = gridAutoFlow;
+}</pre>
+
+<p>{{EmbedLiveSample("Example", "200px", "230px")}}</p>
+
+<h2 id="Especificações">Especificações</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Especificação</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comentário</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName("CSS3 Grid", "#propdef-grid-auto-flow", "grid-auto-flow")}}</td>
+ <td>{{Spec2("CSS3 Grid")}}</td>
+ <td>Definição Inicial</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Compatibilidade_de_Browser">Compatibilidade de Browser</h2>
+
+
+
+<p>{{Compat("css.properties.grid-auto-flow")}}</p>
+
+<h2 id="Veja_Também">Veja Também</h2>
+
+<ul>
+ <li>Propriedades CSS relacionadas: {{cssxref("grid-auto-rows")}}, {{cssxref("grid-auto-columns")}}, {{cssxref("grid")}}</li>
+ <li>Guia de Grid Layout: <em><a href="/en-US/docs/Web/CSS/CSS_Grid_Layout/Auto-placement_in_CSS_Grid_Layout">Arrumação automática no grid layout </a></em></li>
+ <li>Video tutorial: <em><a href="http://gridbyexample.com/video/series-auto-placement-order/">Introduzindo arrumação automática no grid e ordem</a></em></li>
+</ul>
+
+<section class="Quick_links" id="Quick_Links">
+<ol>
+ <li><a href="/en-US/docs/Web/CSS"><strong>CSS</strong></a></li>
+ <li><a href="/en-US/docs/Web/CSS/Reference"><strong>CSS Reference</strong></a></li>
+ <li><a href="/en-US/docs/Web/CSS/CSS_Grid_Layout">CSS Grid Layout</a></li>
+ <li data-default-state="open"><a href="#"><strong>Guias</strong></a>
+ <ol>
+ <li><a href="/en-US/docs/Web/CSS/CSS_Grid_Layout/Basic_Concepts_of_Grid_Layout">Conceitos básicos do grid layout</a></li>
+ <li><a href="/en-US/docs/Web/CSS/CSS_Grid_Layout/Relationship_of_Grid_Layout">Relacionamento com outros tipos de layout</a></li>
+ <li><a href="/en-US/docs/Web/CSS/CSS_Grid_Layout/Line-based_Placement_with_CSS_Grid">Arrumação baseada em linha</a></li>
+ <li><a href="/en-US/docs/Web/CSS/CSS_Grid_Layout/Grid_Template_Areas">Grid template areas</a></li>
+ <li><a href="/en-US/docs/Web/CSS/CSS_Grid_Layout/Layout_using_Named_Grid_Lines">Layout usando named grid lines</a></li>
+ <li><a href="/en-US/docs/Web/CSS/CSS_Grid_Layout/Auto-placement_in_CSS_Grid_Layout">Arrumação automática no grid layout</a></li>
+ <li><a href="/en-US/docs/Web/CSS/CSS_Grid_Layout/Box_Alignment_in_CSS_Grid_Layout">Alinhamento de Box no grid layout</a></li>
+ <li><a href="/en-US/docs/Web/CSS/CSS_Grid_Layout/CSS_Grid,_Logical_Values_and_Writing_Modes">Grids, logical values e writing modes</a></li>
+ <li><a href="/en-US/docs/Web/CSS/CSS_Grid_Layout/CSS_Grid_Layout_and_Accessibility">CSS Grid Layout e Acessibilidade</a></li>
+ <li><a href="/en-US/docs/Web/CSS/CSS_Grid_Layout/CSS_Grid_and_Progressive_Enhancement">CSS Grid Layout e Progressive Enhancement</a></li>
+ <li><a href="/en-US/docs/Web/CSS/CSS_Grid_Layout/Realizing_common_layouts_using_CSS_Grid_Layout">Identificando layouts comuns usando grids</a></li>
+ </ol>
+ </li>
+ <li data-default-state="open"><a href="#"><strong>Propriedades</strong></a>
+ <ol>
+ <li><a href="/en-US/docs/Web/CSS/grid">grid</a></li>
+ <li><a href="/en-US/docs/Web/CSS/grid-area">grid-area</a></li>
+ <li><a href="/en-US/docs/Web/CSS/grid-auto-columns">grid-auto-columns</a></li>
+ <li><a href="/en-US/docs/Web/CSS/grid-auto-flow">grid-auto-flow</a></li>
+ <li><a href="/en-US/docs/Web/CSS/grid-auto-rows">grid-auto-rows</a></li>
+ <li><a href="/en-US/docs/Web/CSS/grid-column">grid-column</a></li>
+ <li><a href="/en-US/docs/Web/CSS/grid-column-end">grid-column-end</a></li>
+ <li><a href="/en-US/docs/Web/CSS/grid-column-gap">grid-column-gap</a></li>
+ <li><a href="/en-US/docs/Web/CSS/grid-column-start">grid-column-start</a></li>
+ <li><a href="/en-US/docs/Web/CSS/grid-gap">grid-gap</a></li>
+ <li><a href="/en-US/docs/Web/CSS/grid-row">grid-row</a></li>
+ <li><a href="/en-US/docs/Web/CSS/grid-row-end">grid-row-end</a></li>
+ <li><a href="/en-US/docs/Web/CSS/grid-row-gap">grid-row-gap</a></li>
+ <li><a href="/en-US/docs/Web/CSS/grid-row-start">grid-row-start</a></li>
+ <li><a href="/en-US/docs/Web/CSS/grid-template">grid-template</a></li>
+ <li><a href="/en-US/docs/Web/CSS/grid-template-areas">grid-template-areas</a></li>
+ <li><a href="/en-US/docs/Web/CSS/grid-template-columns">grid-template-columns</a></li>
+ <li><a href="/en-US/docs/Web/CSS/grid-template-rows">grid-template-rows</a></li>
+ </ol>
+ </li>
+ <li data-default-state="open"><a href="#"><strong>Glossário</strong></a>
+ <ol>
+ <li><a href="/en-US/docs/Glossary/Grid_lines">Grid lines</a></li>
+ <li><a href="/en-US/docs/Glossary/Grid_tracks">Grid tracks</a></li>
+ <li><a href="/en-US/docs/Glossary/Grid_cell">Grid cell</a></li>
+ <li><a href="/en-US/docs/Glossary/Grid_areas">Grid areas</a></li>
+ <li><a href="/en-US/docs/Glossary/Gutters">Gutters</a></li>
+ <li><a href="/en-US/docs/Glossary/Grid_rows">Grid row</a></li>
+ <li><a href="/en-US/docs/Glossary/Grid_column">Grid column</a></li>
+ </ol>
+ </li>
+</ol>
+</section>