{"id":16912,"date":"2013-04-12T18:01:01","date_gmt":"2013-04-12T10:01:01","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=16912"},"modified":"2025-04-04T01:32:04","modified_gmt":"2025-04-03T17:32:04","slug":"ui-design-an-intro-to-flexible-box","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/ui-design-an-intro-to-flexible-box\/","title":{"rendered":"Understanding Flexbox: A Modern Approach to UI Design"},"content":{"rendered":"<p>In a previous post about <a href=\"https:\/\/www.hongkiat.com\/blog\/css3-box-sizing\/\">CSS3 Box-sizing<\/a>, we discussed that HTML elements are essentially \u201cboxes\u201d. Traditionally, when positioning these boxes to the right or left, the <strong>float<\/strong> property was used.<\/p>\n<pre>\r\n.main {\r\n  float: left; \r\n}\r\n.sidebar {\r\n  float: right;\r\n}\r\n<\/pre>\n<p>However, a major downside of this technique is that the direct parent element of <code>.main<\/code> and <code>.sidebar<\/code> will collapse, as shown below.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/css3-flexbox\/collapse.jpg\" width=\"500\" height=\"280\" alt=\"Collapsed parent element issue due to floating child elements\"><\/figure>\n<p>To counter this effect, CSS clearfix is often applied to the parent element.<\/p>\n<h2>Introduction to the Flexible Box Module<\/h2>\n<p>As this issue became common in web design, the W3C introduced a new module called Flexible Box, or simply Flexbox. However, <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/drafts.csswg.org\/css-flexbox-1\/\">this module is still in the draft stage<\/a> and has undergone several changes over the years.<\/p>\n<p>As of the time of writing, this module is fully supported in modern browsers like Chrome and Opera, according to <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/caniuse.com\/flexbox\">CanIUse.com<\/a>. Now, let\u2019s explore how this module works.<\/p>\n<p>To demonstrate the Flexbox feature, let\u2019s start with the HTML structure. We\u2019ll use a <code>div<\/code> container that holds two other <code>div<\/code> elements, like so:<\/p>\n<pre>\r\n&lt;div class=\"cf\"&gt;\r\n  &lt;div class=\"col left\"&gt;\r\n    &lt;p&gt;Pastry icing sweet roll fruitcake croissant. Tart wypas tiramisu marshmallow \r\n    marshmallow sweet roll. Cheesecake bear claw pudding bonbon sweet roll powder carrot cake. \r\n    Cake sweet donut tart.&lt;\/p&gt;\r\n  &lt;\/div&gt;\r\n  &lt;div class=\"col right\"&gt;\r\n    &lt;p&gt;Dessert gummies sweet roll. Dessert gummi bears souffl\u00e9 cotton candy icing.\r\n    Lollipop wafer lemon drops toffee chocolate.&lt;\/p&gt;\r\n  &lt;\/div&gt;\r\n&lt;\/div&gt;\r\n<\/pre>\n<p>In this example, the left column represents the main content section, while the right column is the sidebar. Notice that the left column contains more content than the right column.<\/p>\n<p>Traditionally, we would position these columns using floats in the stylesheet. We would <strong>float the columns<\/strong>, specify the appropriate width, and include a <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/nicolasgallagher.com\/micro-clearfix-hack\/\">CSS clearfix<\/a>, as shown below:<\/p>\n<pre>\r\n.cf:before,\r\n.cf:after {\r\n  content: \"\";\r\n  display: table;\r\n}\r\n.cf:after {\r\n  clear: both;\r\n}\r\n.cf {\r\n  *zoom: 1;\r\n}\r\n.old .col {\r\n  float: left;\r\n}\r\n.old .left {\r\n  width: 310px;\r\n}\r\n.old .right {\r\n  width: 210px;\r\n}\r\n<\/pre>\n<p>This is what the result typically looks like:<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/css3-flexbox\/old-way.jpg\" width=\"500\" height=\"280\" alt=\"Result of traditional float layout\"><\/figure>\n<p>With the Flexbox module, the process becomes much simpler. You only need to set the parent\u2019s <code>display<\/code> property to <code>flex<\/code>:<\/p>\n<pre>\r\n.flex {\r\n  display: -webkit-flex;\r\n  display: flex;\r\n}\r\n<\/pre>\n<p>Interestingly, Flexbox automatically determines the appropriate <code>width<\/code> for the child <code>div<\/code> elements without needing explicit width settings in the stylesheet. Here\u2019s how it looks:<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/css3-flexbox\/flex.jpg\" width=\"500\" height=\"280\" alt=\"Result of layout using Flexbox\"><\/figure>\n<p>You can also apply Flexbox to child elements. For example, applying Flexbox to the left column will divide the content inside it into flex items:<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/css3-flexbox\/flex-2.jpg\" width=\"500\" height=\"280\" alt=\"Dividing content within a column using Flexbox\"><\/figure>\n<h2>Understanding Flexbox Syntax<\/h2>\n<p>There are several syntax variations within the Flexible Box module, which have evolved over the years. For instance, in 2009, the specification used <code>display: box<\/code>, which later changed to <code>display: flexbox<\/code> in 2011. Therefore, it\u2019s advisable to wait until this module is finalized before implementing it widely on websites.<\/p>\n<p><a href=\"\" class=\"su-button su-button-style-flat\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:0px\" target=\"__blank\" rel=\"noopener nofollow\"><span style=\"color:#FFFFFF;padding:7px 20px;font-size:16px;line-height:24px;border-color:#6cadf4;border-radius:0px;text-shadow:none\"><i class=\"sui sui-external-link\" style=\"font-size:16px;color:#fff\"><\/i>  View Demo <\/span><\/a>\n<a href=\"\" class=\"su-button su-button-style-flat\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:0px\" target=\"__blank\" rel=\"noopener nofollow\"><span style=\"color:#FFFFFF;padding:7px 20px;font-size:16px;line-height:24px;border-color:#6cadf4;border-radius:0px;text-shadow:none\"><i class=\"sui sui-external-link\" style=\"font-size:16px;color:#fff\"><\/i>  Download Source <\/span><\/a> <\/p>","protected":false},"excerpt":{"rendered":"<p>In a previous post about CSS3 Box-sizing, we discussed that HTML elements are essentially \u201cboxes\u201d. Traditionally, when positioning these boxes to the right or left, the float property was used. .main { float: left; } .sidebar { float: right; } However, a major downside of this technique is that the direct parent element of .main&hellip;<\/p>\n","protected":false},"author":113,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3392,3395,352],"tags":[507],"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.7) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Understanding Flexbox: A Modern Approach to UI Design - Hongkiat<\/title>\n<meta name=\"description\" content=\"In a previous post about CSS3 Box-sizing, we discussed that HTML elements are essentially &quot;boxes&quot;. Traditionally, when positioning these boxes to the\" \/>\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\/ui-design-an-intro-to-flexible-box\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Understanding Flexbox: A Modern Approach to UI Design\" \/>\n<meta property=\"og:description\" content=\"In a previous post about CSS3 Box-sizing, we discussed that HTML elements are essentially &quot;boxes&quot;. Traditionally, when positioning these boxes to the\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/ui-design-an-intro-to-flexible-box\/\" \/>\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=\"2013-04-12T10:01:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-03T17:32:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/css3-flexbox\/collapse.jpg\" \/>\n<meta name=\"author\" content=\"Thoriq Firdaus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@tfirdaus\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Thoriq Firdaus\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/ui-design-an-intro-to-flexible-box\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/ui-design-an-intro-to-flexible-box\\\/\"},\"author\":{\"name\":\"Thoriq Firdaus\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e7948c7a175d211496331e4b6ce55807\"},\"headline\":\"Understanding Flexbox: A Modern Approach to UI Design\",\"datePublished\":\"2013-04-12T10:01:01+00:00\",\"dateModified\":\"2025-04-03T17:32:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/ui-design-an-intro-to-flexible-box\\\/\"},\"wordCount\":405,\"commentCount\":18,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/ui-design-an-intro-to-flexible-box\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/css3-flexbox\\\/collapse.jpg\",\"keywords\":[\"CSS\"],\"articleSection\":[\"Coding\",\"UI\\\/UX\",\"Web Design\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/ui-design-an-intro-to-flexible-box\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/ui-design-an-intro-to-flexible-box\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/ui-design-an-intro-to-flexible-box\\\/\",\"name\":\"Understanding Flexbox: A Modern Approach to UI Design - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/ui-design-an-intro-to-flexible-box\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/ui-design-an-intro-to-flexible-box\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/css3-flexbox\\\/collapse.jpg\",\"datePublished\":\"2013-04-12T10:01:01+00:00\",\"dateModified\":\"2025-04-03T17:32:04+00:00\",\"description\":\"In a previous post about CSS3 Box-sizing, we discussed that HTML elements are essentially \\\"boxes\\\". Traditionally, when positioning these boxes to the\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/ui-design-an-intro-to-flexible-box\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/ui-design-an-intro-to-flexible-box\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/ui-design-an-intro-to-flexible-box\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/css3-flexbox\\\/collapse.jpg\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/css3-flexbox\\\/collapse.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/ui-design-an-intro-to-flexible-box\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Understanding Flexbox: A Modern Approach to UI Design\"}]},{\"@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\\\/e7948c7a175d211496331e4b6ce55807\",\"name\":\"Thoriq Firdaus\",\"description\":\"Thoriq is a writer for Hongkiat.com with a passion for web design and development. He is the author of Responsive Web Design by Examples, where he covered his best approaches in developing responsive websites quickly with a framework.\",\"sameAs\":[\"https:\\\/\\\/thoriq.com\",\"https:\\\/\\\/x.com\\\/tfirdaus\"],\"jobTitle\":\"Web Developer\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/thoriq\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Understanding Flexbox: A Modern Approach to UI Design - Hongkiat","description":"In a previous post about CSS3 Box-sizing, we discussed that HTML elements are essentially \"boxes\". Traditionally, when positioning these boxes to the","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\/ui-design-an-intro-to-flexible-box\/","og_locale":"en_US","og_type":"article","og_title":"Understanding Flexbox: A Modern Approach to UI Design","og_description":"In a previous post about CSS3 Box-sizing, we discussed that HTML elements are essentially \"boxes\". Traditionally, when positioning these boxes to the","og_url":"https:\/\/www.hongkiat.com\/blog\/ui-design-an-intro-to-flexible-box\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2013-04-12T10:01:01+00:00","article_modified_time":"2025-04-03T17:32:04+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/css3-flexbox\/collapse.jpg","type":"","width":"","height":""}],"author":"Thoriq Firdaus","twitter_card":"summary_large_image","twitter_creator":"@tfirdaus","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Thoriq Firdaus","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/ui-design-an-intro-to-flexible-box\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/ui-design-an-intro-to-flexible-box\/"},"author":{"name":"Thoriq Firdaus","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e7948c7a175d211496331e4b6ce55807"},"headline":"Understanding Flexbox: A Modern Approach to UI Design","datePublished":"2013-04-12T10:01:01+00:00","dateModified":"2025-04-03T17:32:04+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/ui-design-an-intro-to-flexible-box\/"},"wordCount":405,"commentCount":18,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/ui-design-an-intro-to-flexible-box\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/css3-flexbox\/collapse.jpg","keywords":["CSS"],"articleSection":["Coding","UI\/UX","Web Design"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/ui-design-an-intro-to-flexible-box\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/ui-design-an-intro-to-flexible-box\/","url":"https:\/\/www.hongkiat.com\/blog\/ui-design-an-intro-to-flexible-box\/","name":"Understanding Flexbox: A Modern Approach to UI Design - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/ui-design-an-intro-to-flexible-box\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/ui-design-an-intro-to-flexible-box\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/css3-flexbox\/collapse.jpg","datePublished":"2013-04-12T10:01:01+00:00","dateModified":"2025-04-03T17:32:04+00:00","description":"In a previous post about CSS3 Box-sizing, we discussed that HTML elements are essentially \"boxes\". Traditionally, when positioning these boxes to the","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/ui-design-an-intro-to-flexible-box\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/ui-design-an-intro-to-flexible-box\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/ui-design-an-intro-to-flexible-box\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/css3-flexbox\/collapse.jpg","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/css3-flexbox\/collapse.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/ui-design-an-intro-to-flexible-box\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Understanding Flexbox: A Modern Approach to UI Design"}]},{"@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\/e7948c7a175d211496331e4b6ce55807","name":"Thoriq Firdaus","description":"Thoriq is a writer for Hongkiat.com with a passion for web design and development. He is the author of Responsive Web Design by Examples, where he covered his best approaches in developing responsive websites quickly with a framework.","sameAs":["https:\/\/thoriq.com","https:\/\/x.com\/tfirdaus"],"jobTitle":"Web Developer","url":"https:\/\/www.hongkiat.com\/blog\/author\/thoriq\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-4oM","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/16912","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\/113"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=16912"}],"version-history":[{"count":4,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/16912\/revisions"}],"predecessor-version":[{"id":73587,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/16912\/revisions\/73587"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=16912"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=16912"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=16912"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=16912"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}