{"id":30039,"date":"2017-05-22T23:01:21","date_gmt":"2017-05-22T15:01:21","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=30039"},"modified":"2025-04-04T00:02:06","modified_gmt":"2025-04-03T16:02:06","slug":"css-grid-layout-fr-unit","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/css-grid-layout-fr-unit\/","title":{"rendered":"Guide to CSS Grid Layout Fr Unit"},"content":{"rendered":"<p>The <strong><a href=\"https:\/\/www.hongkiat.com\/blog\/css-grid-layout-module\/\">CSS Grid Layout Module<\/a><\/strong> was shipped with a <strong>new CSS unit<\/strong> called the <strong><code>fr<\/code> unit<\/strong>. As straightforward as it can be, <code>fr<\/code> is the <strong>abbreviation of the word \u201cfraction\u201d<\/strong>. The new unit makes it possible to quickly slice the grid up into proportional columns or rows. As a result, the creation of <strong>fully responsive and flexible grids<\/strong> becomes almost a breeze.<\/p>\n<p>As the fraction unit was introduced together with the Grid Layout module, you can use it in any browser that <strong><a href=\"https:\/\/caniuse.com\/#search=grid%20layout\" target=\"_blank\" rel=\"noopener\">supports the CSS grid<\/a><\/strong>. If you also want to support older browsers here\u2019s a great <strong><a href=\"https:\/\/github.com\/FremyCompany\/css-grid-polyfill\" target=\"_blank\" rel=\"noopener\">CSS grid polyfill<\/a><\/strong> that allows you to use not only the <code>fr<\/code> unit but other grid features as well.<\/p>\n<p class=\"recommended_top\">\n\t\t\t\t\t<strong>Read Also:<\/strong>\u00a0\n\t\t\t\t\t<a target=\"_blank\" href=\"https:\/\/www.hongkiat.com\/blog\/css-grid-layout-module\/\">Introduction to the CSS Grid Layout Module<\/a>\n\t\t\t\t<\/p>\n<figure><a href=\"https:\/\/caniuse.com\/#search=grid%20layout\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/css-grid-layout-fr-unit\/caniuse-grid-layout.jpg\" width=\"800\" height=\"483\" alt=\"CanIUse Grid Layout\"><\/a><\/figure>\n<h2>Basic usage<\/h2>\n<p>First, let\u2019s have a look at a <strong>basic grid<\/strong> that uses the fraction unit. The layout below divides the space into <strong>three equal-width columns<\/strong> and <strong>two equal-height rows<\/strong>.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/css-grid-layout-fr-unit\/basic-usage.jpg\" width=\"756\" height=\"320\" alt=\"Basic usage\"><\/figure>\n<p>The belonging HTML is made of <strong>six divs<\/strong> marked with the <code>.box<\/code> class, <strong>inside a <code>.wrapper<\/code> div<\/strong>.<\/p>\n<pre>\r\n&lt;div class=\"wrapper\"&gt;\r\n  &lt;div class=\"box box-1\"&gt;1.&lt;\/div&gt;\r\n  &lt;div class=\"box box-2\"&gt;2.&lt;\/div&gt;\r\n  &lt;div class=\"box box-3\"&gt;3.&lt;\/div&gt;\r\n  &lt;div class=\"box box-4\"&gt;4.&lt;\/div&gt;\r\n  &lt;div class=\"box box-5\"&gt;5.&lt;\/div&gt;\r\n  &lt;div class=\"box box-6\"&gt;6.&lt;\/div&gt;\r\n&lt;\/div&gt;\r\n<\/pre>\n<p>To use the Grid Layout module, you need to add the <code>display: grid;<\/code> CSS property to the wrapper. The <code>grid-template-columns<\/code> property uses the <code>fr<\/code> unit as value; the <strong>ratio of the three columns is 1:1:1<\/strong>.<\/p>\n<p>For the grid rows (<code>grid-template-rows<\/code> property), I didn\u2019t use the <code>fr<\/code> unit, as it only makes sense if the wrapper <strong>has a fixed height<\/strong>. Otherwise, it can have strange results on some devices, however, even then, the <code>fr<\/code> unit <strong>does maintain the ratio<\/strong> (and this is huge).<\/p>\n<p>The <code>grid-gap<\/code> property <strong>adds a 10px grid<\/strong> in-between the boxes. If you don\u2019t want any gap just remove this property.<\/p>\n<pre>\r\n.wrapper {\r\n  display: grid;\r\n  grid-template-columns: 1fr 1fr 1fr;\r\n  grid-template-rows: 200px 200px;\r\n  grid-gap: 10px;\r\n}\r\n.box {\r\n  color: white;\r\n  text-align: center;\r\n  font-size: 30px;\r\n  padding: 25px;\r\n}\r\n<\/pre>\n<p>Note the CSS above doesn\u2019t contain some basic styling such as background colors. You can <strong>find the full code in the demo at the end of the article<\/strong>.<\/p>\n<h2>Change ratio<\/h2>\n<p>Of course, you can\u2019t only use 1:1:1 but <strong>any ratio you want<\/strong>. Below, I used <strong>1:2:1 fractions<\/strong> that also divide the space into <strong>three columns<\/strong> but the middle column will be <strong>twice as wide<\/strong> as the other two.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/css-grid-layout-fr-unit\/change-ratio.jpg\" width=\"761\" height=\"342\" alt=\"Change ratio\"><\/figure>\n<p>I also increased the value of <code>grid-gap<\/code> so that you can see how it changes the layout. Basically, the browser <strong>deducts the grid gap from the viewport width<\/strong> (in this example, the grid gaps add up to 80px), and <strong>slices up the rest<\/strong> according to the given fractions.<\/p>\n<pre>\r\n.wrapper {\r\n  display: grid;\r\n  grid-template-columns: 1fr 2fr 1fr;\r\n  grid-template-rows: 200px 200px;\r\n  grid-gap: 40px;\r\n}\r\n<\/pre>\n<h2>Combine <code>fr<\/code> with other CSS units<\/h2>\n<p>You can <strong>combine<\/strong> the <code>fr<\/code> unit with <strong>any other CSS units<\/strong> as well. For instance, in the example below, I used the <code>60% 1fr 2fr<\/code> ratio for my grid.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/css-grid-layout-fr-unit\/combine-units.jpg\" width=\"755\" height=\"319\" alt=\"Combine units\"><\/figure>\n<p>So, how does this work? The <strong>browser assigns the 60% of the viewport width<\/strong> to the first column. Then, it divides the rest of the space into 1:2 fractions.<\/p>\n<p>The same thing could also be written as <code>60% 13.33333% 26.66667%<\/code>. But frankly, why would anyone want to use that format? A huge advantage of fraction unit is that it <strong>improves code readability<\/strong>. Moreover, it\u2019s <strong>completely accurate<\/strong>, as the percentage format still adds up only to 99.9999%.<\/p>\n<pre>\r\n.wrapper {\r\n  display: grid;\r\n  grid-template-columns: 60% 1fr 2fr;\r\n  grid-template-rows: 200px 200px;\r\n  grid-gap: 10px;\r\n}\r\n<\/pre>\n<p>Apart from percentages, <strong>you can also use other <a href=\"https:\/\/www.hongkiat.com\/blog\/css-units\/\">CSS units<\/a><\/strong> together with the fraction unit, for instance <code>pt<\/code>, <code>px<\/code>, <code>em<\/code>, and <code>rem<\/code>.<\/p>\n<h2>Add whitespace with <code>fr<\/code><\/h2>\n<p>What if you don\u2019t want your design to be cluttered and <strong>add some whitespace<\/strong> to your grid? The fraction unit also has an easy solution for that.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/css-grid-layout-fr-unit\/add-whitespace.jpg\" width=\"753\" height=\"322\" alt=\"Add whitespace\"><\/figure>\n<p>As you can see, this grid <strong>has an empty column<\/strong> while it still retains all the six boxes. For this layout, we need to slice the space up <strong>into four columns<\/strong> instead of three. So, we use the <code>1fr 1fr 1fr 1fr<\/code> value for the <code>grid-template-columns<\/code> property.<\/p>\n<p>We add the empty column inside the <strong><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/grid-template-areas\" target=\"_blank\" rel=\"noopener\"><code>grid-template-areas<\/code><\/a><\/strong> property, using the <strong>dot notation<\/strong>. Basically, this property allows you to <strong>reference named grid areas<\/strong>. And, you can name grid areas with the <strong><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/grid-area\" target=\"_blank\" rel=\"noopener\"><code>grid-area<\/code><\/a><\/strong> property that you need to use <strong>separately for each area<\/strong>.<\/p>\n<pre>\r\n.wrapper {\r\n  display: grid;\r\n  grid-template-columns: 1fr 1fr 1fr 1fr;\r\n  grid-template-rows: 200px 200px;\r\n  grid-gap: 10px;\r\n  grid-template-areas:\r\n    \"box-1 box-2 . box-3\"\r\n    \"box-4 box-5 . box-6\";\r\n}\r\n.box-1 {\r\n  grid-area: box-1;\r\n}\r\n.box-2 {\r\n  grid-area: box-2;\r\n}\r\n.box-3 {\r\n  grid-area: box-3;\r\n}\r\n.box-4 {\r\n  grid-area: box-4;\r\n}\r\n.box-5 {\r\n  grid-area: box-5;\r\n}\r\n.box-6 {\r\n grid-area: box-6;\r\n}\r\n<\/pre>\n<p>The whitespace areas <strong>don\u2019t necessarily have to form a column<\/strong>, they <strong>can be anywhere<\/strong> in the grid.<\/p>\n<h2>The <code>repeat()<\/code> function<\/h2>\n<p>You can also use the <code>fr<\/code> unit <strong>together with the <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/repeat\" target=\"_blank\" rel=\"noopener\"><code>repeat()<\/code><\/a> function<\/strong> for a <strong>simpler syntax<\/strong>. , this is not necessary if you only have a simple grid but can come in handy when you want to <strong>implement a complicated layout<\/strong>, for instance a <strong>nested grid<\/strong>.<\/p>\n<pre>\r\n.wrapper {\r\n  display: grid;\r\n  grid-template-columns: repeat(3, 1fr);\r\n  \/* grid-template-columns: 1fr 1fr 1fr; *\/\r\n  grid-template-rows: 200px;\r\n  grid-gap: 10px;\r\n}\r\n<\/pre>\n<p>The <code>repeat(3, 1fr)<\/code> syntax <strong>results in the same layout<\/strong> as <code>1fr 1fr 1fr<\/code>. The layout below is the same as the first example.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/css-grid-layout-fr-unit\/basic-usage.jpg\" width=\"756\" height=\"320\" alt=\"Basic usage\"><\/figure>\n<p>If you <strong>increase the multiplier<\/strong> inside the <code>repeat()<\/code> function you will have more columns. For instance, <code>repeat(6, 1fr)<\/code> results in <strong>six equal columns<\/strong>. In this case, all our boxes <strong>will be in the same row<\/strong>, which means it\u2019s enough to use only one value (200px) for the <code>grid-template-rows<\/code> property.<\/p>\n<pre>\r\n.wrapper {\r\n  display: grid;\r\n  grid-template-columns: repeat(6, 1fr);\r\n  grid-template-rows: 200px;\r\n  grid-gap: 10px;\r\n}\r\n<\/pre>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/css-grid-layout-fr-unit\/repeat-once.jpg\" width=\"755\" height=\"163\" alt=\"Repeat() function\"><\/figure>\n<p>You can use <code>repeat()<\/code> <strong>more than once<\/strong>. For instance, the following example results in a grid in which the last three columns are <strong>twice as wide<\/strong> as the first three.<\/p>\n<pre>\r\n.wrapper {\r\n  display: grid;\r\n  grid-template-columns: repeat(3, 1fr) repeat(3, 2fr);\r\n  grid-template-rows: 200px;\r\n  grid-gap: 10px;\r\n}\r\n<\/pre>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/css-grid-layout-fr-unit\/repeat-twice.jpg\" width=\"758\" height=\"169\" alt=\"Repeat() function, used twice\"><\/figure>\n<p>You can also <strong>combine <code>repeat()<\/code> with other CSS units<\/strong>. For instance, you could use <code>200px repeat(4, 1fr) 200px<\/code> as a valid code.<\/p>\n<p>If you are interested in how to <strong>create complex layouts<\/strong> with the CSS Grid module, the <code>repeat()<\/code> function and the <code>fr<\/code> unit Rachel Andrew has an interesting blog post on <a href=\"https:\/\/rachelandrew.co.uk\/archives\/2015\/02\/04\/css-grid-layout-creating-complex-grids\/\" target=\"_blank\" rel=\"noopener\">how you can do that<\/a>.<\/p>\n<h2>A demo for experimenting<\/h2>\n<p>Finally, <strong>here\u2019s the demo I promised<\/strong>. It uses the same code as the first example in this article. Fork it, and see what you can achieve with the <code>fr<\/code> unit.<\/p>\n<p><iframe height=\"537\" scrolling=\"no\" title=\"Starter demo for fr units and CSS grid\" src=\"https:\/\/codepen.io\/\/hkdc\/embed\/QvmOBV\/?height=537&theme-id=0&default-tab=result&embed-version=2\" frameborder=\"no\" allowtransparency=\"true\" allowfullscreen=\"true\" style=\"width: 100%;\">See the Pen <a href=\"https:\/\/codepen.io\/hkdc\/pen\/QvmOBV\/\" rel=\"nofollow\">Starter demo for fr units and CSS grid<\/a> by HONGKIAT (<a href=\"https:\/\/codepen.io\/\/hkdc\" rel=\"nofollow\">@hkdc<\/a>) on <a href=\"https:\/\/codepen.io\/\" rel=\"nofollow\">CodePen<\/a>. <\/iframe><\/p>\n<p class=\"recommended_top\">\n\t\t\t\t\t<strong>Read Also:<\/strong>\u00a0\n\t\t\t\t\t<a target=\"_blank\" href=\"https:\/\/www.hongkiat.com\/blog\/css-grid-wordpress\/\">How to Integrate Simple CSS Grid Layouts into WordPress<\/a>\n\t\t\t\t<\/p>","protected":false},"excerpt":{"rendered":"<p>The CSS Grid Layout Module was shipped with a new CSS unit called the fr unit. As straightforward as it can be, fr is the abbreviation of the word \u201cfraction\u201d. The new unit makes it possible to quickly slice the grid up into proportional columns or rows. As a result, the creation of fully responsive&hellip;<\/p>\n","protected":false},"author":146,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[3392],"tags":[507,4319,4501],"topic":[4520],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Guide to CSS Grid Layout Fr Unit - Hongkiat<\/title>\n<meta name=\"description\" content=\"The CSS Grid Layout Module was shipped with a new CSS unit called the fr unit. As straightforward as it can be, fr is the abbreviation of the word\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hongkiat.com\/blog\/css-grid-layout-fr-unit\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Guide to CSS Grid Layout Fr Unit\" \/>\n<meta property=\"og:description\" content=\"The CSS Grid Layout Module was shipped with a new CSS unit called the fr unit. As straightforward as it can be, fr is the abbreviation of the word\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/css-grid-layout-fr-unit\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2017-05-22T15:01:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-03T16:02:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/css-grid-layout-fr-unit\/caniuse-grid-layout.jpg\" \/>\n<meta name=\"author\" content=\"Anna Monus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Anna Monus\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-grid-layout-fr-unit\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-grid-layout-fr-unit\\\/\"},\"author\":{\"name\":\"Anna Monus\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/a601053a0ab457901e00cdc83bd5359e\"},\"headline\":\"Guide to CSS Grid Layout Fr Unit\",\"datePublished\":\"2017-05-22T15:01:21+00:00\",\"dateModified\":\"2025-04-03T16:02:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-grid-layout-fr-unit\\\/\"},\"wordCount\":871,\"commentCount\":10,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-grid-layout-fr-unit\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/css-grid-layout-fr-unit\\\/caniuse-grid-layout.jpg\",\"keywords\":[\"CSS\",\"CSS Grid Layout\",\"CSS Tutorials\"],\"articleSection\":[\"Coding\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-grid-layout-fr-unit\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-grid-layout-fr-unit\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-grid-layout-fr-unit\\\/\",\"name\":\"Guide to CSS Grid Layout Fr Unit - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-grid-layout-fr-unit\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-grid-layout-fr-unit\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/css-grid-layout-fr-unit\\\/caniuse-grid-layout.jpg\",\"datePublished\":\"2017-05-22T15:01:21+00:00\",\"dateModified\":\"2025-04-03T16:02:06+00:00\",\"description\":\"The CSS Grid Layout Module was shipped with a new CSS unit called the fr unit. As straightforward as it can be, fr is the abbreviation of the word\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-grid-layout-fr-unit\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-grid-layout-fr-unit\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-grid-layout-fr-unit\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/css-grid-layout-fr-unit\\\/caniuse-grid-layout.jpg\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/css-grid-layout-fr-unit\\\/caniuse-grid-layout.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css-grid-layout-fr-unit\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Guide to CSS Grid Layout Fr Unit\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/a601053a0ab457901e00cdc83bd5359e\",\"name\":\"Anna Monus\",\"description\":\"Anna is Technical Editor and Writer for Hongkiat.com. She mainly covers front-end frameworks, web standards, accessibility, WordPress development, and UX design.\",\"sameAs\":[\"https:\\\/\\\/www.annalytic.com\\\/\"],\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/anna_monus\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Guide to CSS Grid Layout Fr Unit - Hongkiat","description":"The CSS Grid Layout Module was shipped with a new CSS unit called the fr unit. As straightforward as it can be, fr is the abbreviation of the word","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hongkiat.com\/blog\/css-grid-layout-fr-unit\/","og_locale":"en_US","og_type":"article","og_title":"Guide to CSS Grid Layout Fr Unit","og_description":"The CSS Grid Layout Module was shipped with a new CSS unit called the fr unit. As straightforward as it can be, fr is the abbreviation of the word","og_url":"https:\/\/www.hongkiat.com\/blog\/css-grid-layout-fr-unit\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2017-05-22T15:01:21+00:00","article_modified_time":"2025-04-03T16:02:06+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/css-grid-layout-fr-unit\/caniuse-grid-layout.jpg","type":"","width":"","height":""}],"author":"Anna Monus","twitter_card":"summary_large_image","twitter_creator":"@hongkiat","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Anna Monus","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/css-grid-layout-fr-unit\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/css-grid-layout-fr-unit\/"},"author":{"name":"Anna Monus","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/a601053a0ab457901e00cdc83bd5359e"},"headline":"Guide to CSS Grid Layout Fr Unit","datePublished":"2017-05-22T15:01:21+00:00","dateModified":"2025-04-03T16:02:06+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/css-grid-layout-fr-unit\/"},"wordCount":871,"commentCount":10,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/css-grid-layout-fr-unit\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/css-grid-layout-fr-unit\/caniuse-grid-layout.jpg","keywords":["CSS","CSS Grid Layout","CSS Tutorials"],"articleSection":["Coding"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/css-grid-layout-fr-unit\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/css-grid-layout-fr-unit\/","url":"https:\/\/www.hongkiat.com\/blog\/css-grid-layout-fr-unit\/","name":"Guide to CSS Grid Layout Fr Unit - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/css-grid-layout-fr-unit\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/css-grid-layout-fr-unit\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/css-grid-layout-fr-unit\/caniuse-grid-layout.jpg","datePublished":"2017-05-22T15:01:21+00:00","dateModified":"2025-04-03T16:02:06+00:00","description":"The CSS Grid Layout Module was shipped with a new CSS unit called the fr unit. As straightforward as it can be, fr is the abbreviation of the word","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/css-grid-layout-fr-unit\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/css-grid-layout-fr-unit\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/css-grid-layout-fr-unit\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/css-grid-layout-fr-unit\/caniuse-grid-layout.jpg","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/css-grid-layout-fr-unit\/caniuse-grid-layout.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/css-grid-layout-fr-unit\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Guide to CSS Grid Layout Fr Unit"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/a601053a0ab457901e00cdc83bd5359e","name":"Anna Monus","description":"Anna is Technical Editor and Writer for Hongkiat.com. She mainly covers front-end frameworks, web standards, accessibility, WordPress development, and UX design.","sameAs":["https:\/\/www.annalytic.com\/"],"url":"https:\/\/www.hongkiat.com\/blog\/author\/anna_monus\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-7Ov","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/30039","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/146"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=30039"}],"version-history":[{"count":3,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/30039\/revisions"}],"predecessor-version":[{"id":73480,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/30039\/revisions\/73480"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=30039"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=30039"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=30039"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=30039"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}