{"id":1506,"date":"2024-08-02T06:58:52","date_gmt":"2024-08-02T04:58:52","guid":{"rendered":"https:\/\/blog.sutilweb.eu\/?page_id=1506"},"modified":"2024-08-02T06:58:52","modified_gmt":"2024-08-02T04:58:52","slug":"07-huecos-gaps","status":"publish","type":"page","link":"https:\/\/sutilweb.eu\/index.php\/lenguajes\/css3\/flex-css\/07-huecos-gaps\/","title":{"rendered":"07. Huecos (gaps)"},"content":{"rendered":"\n<p>A todas las propiedades existentes para Flexbox, se unieron dos nuevas de manera reciente,&nbsp; <code><strong><em>row-gap<\/em><\/strong><\/code>&nbsp;y&nbsp;<code><strong><em>column-gap<\/em><\/strong><\/code>, las cuales, permiten establecer el tama\u00f1o de un \u00abhueco\u00bb entre \u00edtems desde el elemento padre contenedor, y sin necesidad de estar utilizando <strong><em><code>padding<\/code>&nbsp;<\/em><\/strong>o&nbsp;<strong><em><code>margin<\/code>&nbsp;<\/em><\/strong>en los elementos hijos.<\/p>\n\n\n\n<!--more-->\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Propiedad<\/th><th>Valor<\/th><th>Descripci\u00f3n<\/th><\/tr><\/thead><tbody><tr><td><code><strong><em>row-gap<\/em><\/strong><\/code><\/td><td><strong>normal<\/strong>&nbsp;|<\/td><td>Espacio entre filas (s\u00f3lo si&nbsp;<strong><em>flex-direction: column<\/em><\/strong>)<\/td><\/tr><tr><td><code><strong><em>column-gap<\/em><\/strong><\/code><\/td><td><strong>normal<\/strong>&nbsp;|<\/td><td>Espacio entre columnas (s\u00f3lo si&nbsp;<strong><em>flex-direction: row<\/em><\/strong>)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong>Nota<\/strong>: s\u00f3lo una de las dos propiedades tendr\u00e1 efecto, dependiendo de si la propiedad <code><strong><em>flex-direction<\/em><\/strong><\/code>&nbsp;est\u00e1 establecida en&nbsp;<code>column<\/code>&nbsp;o en&nbsp;<strong><em><code>row<\/code><\/em><\/strong>. Eso s\u00ed, es posible usar ambas si tenemos la propiedad&nbsp;<code><strong><em>flex-wrap<\/em><\/strong><\/code>&nbsp;definida a&nbsp;<strong><em><code>wrap<\/code><\/em><\/strong>y, por lo tanto, disponemos de multicolumnas flexbox.<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Atajo: gap<\/h2>\n\n\n\n<p>Tenemos un atajo, que podemos usar de la siguiente manera.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Propiedad<\/th><th>Valor<\/th><th>Descripci\u00f3n<\/th><\/tr><\/thead><tbody><tr><td><strong><em><code>gap<\/code><\/em><\/strong><\/td><td><strong>0<\/strong>&nbsp;|<\/td><td>Aplica el tama\u00f1o indicado para el hueco en ambos ejes.<\/td><\/tr><tr><td><code><strong><em>gap<\/em><\/strong><\/code><\/td><td><strong>0 0<\/strong>&nbsp;|<\/td><td>Aplica los tama\u00f1os indicados para el hueco del eje X y el eje Y.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Veamos un ejm para entender su funcionamiento.<\/p>\n\n\n\n<p><strong>Ejm<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&nbsp; &nbsp; &nbsp; .container {\n&nbsp; &nbsp; &nbsp; &nbsp; \/* gap: &lt;row&gt; &lt;column&gt; *\/\n&nbsp; &nbsp; &nbsp; &nbsp; gap: 4px 8px;\n\n&nbsp; &nbsp; &nbsp; &nbsp; \/* 1 par\u00e1metro: usa el mismo para ambos *\/\n&nbsp; &nbsp; &nbsp; &nbsp; gap: 4px;\n&nbsp; &nbsp; &nbsp; }<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>A todas las propiedades existentes para Flexbox, se unieron dos nuevas de manera reciente,&nbsp; row-gap&nbsp;y&nbsp;column-gap, las cuales, permiten establecer el [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1484,"menu_order":6,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"class_list":["post-1506","page","type-page","status-publish","hentry"],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Sutil Web","author_link":"https:\/\/sutilweb.eu\/index.php\/author\/sutilweb\/"},"uagb_comment_info":0,"uagb_excerpt":"A todas las propiedades existentes para Flexbox, se unieron dos nuevas de manera reciente,&nbsp; row-gap&nbsp;y&nbsp;column-gap, las cuales, permiten establecer el [&hellip;]","_links":{"self":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/1506","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/comments?post=1506"}],"version-history":[{"count":2,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/1506\/revisions"}],"predecessor-version":[{"id":1508,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/1506\/revisions\/1508"}],"up":[{"embeddable":true,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/1484"}],"wp:attachment":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/media?parent=1506"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}