{"id":1524,"date":"2024-08-02T07:05:30","date_gmt":"2024-08-02T05:05:30","guid":{"rendered":"https:\/\/blog.sutilweb.eu\/?page_id=1524"},"modified":"2024-08-02T07:05:30","modified_gmt":"2024-08-02T05:05:30","slug":"04-unidad-fraccion-restante-fr","status":"publish","type":"page","link":"https:\/\/sutilweb.eu\/index.php\/lenguajes\/css3\/grid-css\/04-unidad-fraccion-restante-fr\/","title":{"rendered":"04. Unidad fracci\u00f3n restante (fr)"},"content":{"rendered":"\n<p>En el ejemplo del cap\u00edtulo anterior utilizamos <strong>p\u00edxels<\/strong>&nbsp;como <strong>unidades de las celdas de la cuadr\u00edcula<\/strong>, sin embargo, tambi\u00e9n es posible utilizar otras <strong>unidades<\/strong> (o incluso combinarlas) como <strong>porcentajes<\/strong>, la palabra clave&nbsp;<strong>auto<\/strong>&nbsp;(que obtiene el tama\u00f1o restante) o la unidad especial de <strong>Grid CSS<\/strong>&nbsp;<em><strong>fr<\/strong>&nbsp;<\/em>(<strong>fraction<\/strong>), que simboliza una&nbsp;<strong>fracci\u00f3n de espacio restante en el grid<\/strong>.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>Veamos un c\u00f3digo de ejemplo en acci\u00f3n.<\/p>\n\n\n\n<p><strong>Ejm<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&nbsp; &nbsp; .grid {\n&nbsp; &nbsp; &nbsp; display: grid;\n&nbsp; &nbsp; &nbsp; grid-template-columns: 1fr 1fr;\n&nbsp; &nbsp; &nbsp; grid-template-rows: 2fr 1fr;\n&nbsp; &nbsp; }<\/pre>\n\n\n\n<p>Este nuevo ejemplo, creamos una cuadr\u00edcula de 2\u00d72, donde el tama\u00f1o de ancho de la cuadr\u00edcula se divide en <strong>dos columnas<\/strong>&nbsp;(mismo tama\u00f1o de ancho para cada una), y el tama\u00f1o de alto de la cuadr\u00edcula se divide en&nbsp;<strong>dos filas<\/strong>, donde la primera ocupar\u00e1 el doble (<strong><em>2fr<\/em><\/strong>) que la segunda (<strong><em>1fr<\/em><\/strong>). As\u00ed, podemos tener un mejor control del espacio restante de la cuadr\u00edcula, y como utilizarlo.<\/p>\n\n\n\n<p>Se pueden combinar varias&nbsp;<strong>unidades diferentes<\/strong>, pudiendo utilizar <strong>p\u00edxeles<\/strong> (px) y <strong>fracciones restantes<\/strong> (<strong><em>fr<\/em><\/strong>), <strong>porcentajes<\/strong> (<em>%<\/em>) y <strong>fracciones restantes<\/strong> (<strong><em>fr<\/em><\/strong>)&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>En el ejemplo del cap\u00edtulo anterior utilizamos p\u00edxels&nbsp;como unidades de las celdas de la cuadr\u00edcula, sin embargo, tambi\u00e9n es posible [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1511,"menu_order":3,"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-1524","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":"En el ejemplo del cap\u00edtulo anterior utilizamos p\u00edxels&nbsp;como unidades de las celdas de la cuadr\u00edcula, sin embargo, tambi\u00e9n es posible [&hellip;]","_links":{"self":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/1524","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=1524"}],"version-history":[{"count":1,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/1524\/revisions"}],"predecessor-version":[{"id":1525,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/1524\/revisions\/1525"}],"up":[{"embeddable":true,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/1511"}],"wp:attachment":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/media?parent=1524"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}