{"id":494,"date":"2023-11-16T22:20:16","date_gmt":"2023-11-16T22:20:16","guid":{"rendered":"https:\/\/javigomez.org\/?p=494"},"modified":"2025-09-29T20:33:55","modified_gmt":"2025-09-29T20:33:55","slug":"flex-manejo-de-flex-en-css","status":"publish","type":"post","link":"https:\/\/javigomez.org\/index.php\/2023\/11\/16\/flex-manejo-de-flex-en-css\/","title":{"rendered":"Flex &#8211; Manejo de Flex en CSS"},"content":{"rendered":"\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">Modalidades de flex<\/mark><\/strong><\/p>\n\n\n\n<p><strong>Tipo de elemento\u00a0 Descripci\u00f3n<\/strong><\/p>\n\n\n\n<p>display: inline-flex;&nbsp; Establece un contenedor en l\u00ednea, similar a inline-block (ocupa solo el contenido).<\/p>\n\n\n\n<p>display: flex;&nbsp; Establece un contenedor en bloque, similar a block (ocupa todo el ancho del padre).<\/p>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">Direcci\u00f3n de los ejes<\/mark><\/strong><\/p>\n\n\n\n<p><strong>Propiedad&nbsp; Valor&nbsp; Significado<\/strong><\/p>\n\n\n\n<p>flex-direction&nbsp; row | row-reverse | column | column-reverse&nbsp; Cambia la orientaci\u00f3n del eje principal.<\/p>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">Contenedor flex multil\u00ednea<\/mark><\/strong><\/p>\n\n\n\n<p><strong>Propiedad&nbsp; Valor&nbsp; Significado<\/strong><\/p>\n\n\n\n<p>flex-wrap&nbsp; nowrap | wrap | wrap-reverse&nbsp; Evita o permite el desbordamiento (multilinea).<\/p>\n\n\n\n<p><strong>Atajo: Direcci\u00f3n de los ejes<\/strong><\/p>\n\n\n\n<p>flex-flow: &lt;flex-direction&gt; &lt;flex-wrap&gt;;<\/p>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">Huecos (gaps)<\/mark><\/strong><\/p>\n\n\n\n<p><strong>Propiedad&nbsp; Valor&nbsp; Descripci\u00f3n<\/strong><\/p>\n\n\n\n<p>row-gap&nbsp; normal | SIZE&nbsp; Espacio entre filas (s\u00f3lo funciona con flex-direction: column)<\/p>\n\n\n\n<p>column-gap&nbsp; normal | SIZE&nbsp; Espacio entre columnas (s\u00f3lo funciona con flex-direction: row)<\/p>\n\n\n\n<p><strong>Atajo: Huecos<\/strong><\/p>\n\n\n\n<p><strong>Propiedad&nbsp; Valor&nbsp; Descripci\u00f3n<\/strong><\/p>\n\n\n\n<p>gap&nbsp; 0 | SIZE&nbsp; Aplica el tama\u00f1o indicado para el hueco en ambos ejes.<\/p>\n\n\n\n<p>gap\u00a0 0 0 |\u00a0 SIZE SIZE\u00a0 Aplica los tama\u00f1os indicados para el hueco del eje X y el eje Y.<\/p>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">Propiedades de alineaci\u00f3n<\/mark><\/strong><\/p>\n\n\n\n<p><strong>Propiedad&nbsp; Valor&nbsp; Act\u00faa en eje<\/strong><\/p>\n\n\n\n<p>justify-content&nbsp; flex-start | flex-end | center | space-between | space-around | space-evenly&nbsp; eje principal<\/p>\n\n\n\n<p>align-items&nbsp; flex-start | flex-end | center | stretch | baseline&nbsp; eje secundario<\/p>\n\n\n\n<p>align-content&nbsp; flex-start | flex-end | center | space-between | space-around | space-evenly | stretch&nbsp; eje secundario<\/p>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">Alineaciones espec\u00edficas<\/mark><\/strong><\/p>\n\n\n\n<p><strong>Propiedad&nbsp; Valores&nbsp; Act\u00faa en eje<\/strong><\/p>\n\n\n\n<p>align-self&nbsp; auto | flex-start | flex-end | center | stretch | baseline&nbsp; Secundario<\/p>\n\n\n\n<p><strong>Atajo: Alineaciones<\/strong><\/p>\n\n\n\n<p>place-content: &lt;align-content&gt; &lt;justify-content&gt;;<\/p>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">Orden de los elementos<\/mark><\/strong><\/p>\n\n\n\n<p><strong>Propiedad&nbsp; Valor&nbsp; Descripci\u00f3n<\/strong><\/p>\n\n\n\n<p>order&nbsp; 0 | NUMBER&nbsp; N\u00famero (peso) que indica el orden de aparici\u00f3n de los \u00edtems.<\/p>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">Propiedades de flexibilidad<\/mark><\/strong><\/p>\n\n\n\n<p><strong>Propiedad&nbsp; Valor&nbsp; Descripci\u00f3n<\/strong><\/p>\n\n\n\n<p>flex-basis&nbsp; SIZE | content&nbsp; Tama\u00f1o base de los \u00edtems antes de aplicar una variaci\u00f3n.<\/p>\n\n\n\n<p>flex-grow&nbsp; 0 | NUMBER&nbsp; N\u00famero que indica el factor de crecimiento del \u00edtem (si no ocupa el 100% del padre).<\/p>\n\n\n\n<p>flex-shrink&nbsp; 1 | NUMBER&nbsp; N\u00famero que indica el factor de decrecimiento del \u00edtem (si ocupa el 100% del padre).<\/p>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">Atajo: La propiedad flex<\/mark><\/strong><\/p>\n\n\n\n<p><strong>Propiedad&nbsp; Valor&nbsp; Descripci\u00f3n<\/strong><\/p>\n\n\n\n<p>flex (1 par\u00e1metro)&nbsp; none | BASIS | GROW&nbsp; Establece un <strong>tama\u00f1o base <\/strong>o un factor de <strong>crecimiento<\/strong>.<\/p>\n\n\n\n<p>flex (2 par\u00e1metros)&nbsp; GROW SHRINK&nbsp; Establece un factor de <strong>crecimiento<\/strong> y un factor de <strong>decrecimiento<\/strong>.<\/p>\n\n\n\n<p>flex (3 par\u00e1metros)&nbsp; 0 1 auto |GROW SHRINK BASIS&nbsp; Establece el factor de <strong>crecimiento<\/strong> y <strong>decrecimiento<\/strong> y el <strong>tama\u00f1o base<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"FLEX\" width=\"1200\" height=\"675\" src=\"https:\/\/www.youtube.com\/embed\/vIt5Y0C05C8?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Modalidades de flex Tipo de elemento\u00a0 Descripci\u00f3n display: inline-flex;&nbsp; Establece un contenedor en l\u00ednea, similar a inline-block (ocupa solo el contenido). display: flex;&nbsp; Establece un &hellip; <\/p>\n","protected":false},"author":1,"featured_media":495,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[25,26,106,120,153,154,156,157,158,171,210],"class_list":["post-494","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-css","tag-align-content","tag-align-items","tag-css","tag-displayflex","tag-flex","tag-flex-basis","tag-flex-grow","tag-flex-shrink","tag-flex-wrap","tag-gap","tag-justify-content"],"_links":{"self":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/494","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/comments?post=494"}],"version-history":[{"count":1,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/494\/revisions"}],"predecessor-version":[{"id":925,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/494\/revisions\/925"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/media\/495"}],"wp:attachment":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/media?parent=494"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/categories?post=494"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/tags?post=494"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}