{"id":565,"date":"2019-05-10T02:02:41","date_gmt":"2019-05-10T02:02:41","guid":{"rendered":"http:\/\/www.projectimmerse.com\/blog\/?p=565"},"modified":"2026-08-01T02:13:03","modified_gmt":"2026-08-01T02:13:03","slug":"mobile-stacking-order-using-flex","status":"publish","type":"post","link":"https:\/\/www.projectimmerse.com\/blog\/mobile-stacking-order-using-flex\/","title":{"rendered":"Mobile Stacking Order using Flex"},"content":{"rendered":"\r\n<p>I&#8217;m actually not very well versed with using Flex (I definitely should though of course), I really only use it when absolutely necessary &#8211; usually as a fall back plan or when I want to adjust a few elements on mobile. That&#8217;s what this post is really about &#8211; Flex and how it saved me numerous times on one (no, many) of those head scratcher projects.<\/p>\r\n\r\n<!--more-->\r\n\r\n<p>Flex comes in handy when the elements you are working with are untouchable &#8211; meaning you can&#8217;t move markup around, heck you can&#8217;t even add a class to some target element. And, you&#8217;re looking to stay away from using any page specific scripts.<\/p> \r\n\r\n<p>In my recent case, a client wanted to reverse the stacking order for the content and sidebar column on mobile screens. If you have been programming for a while you know that there&#8217;s more than one solution to solving something. But then you need to factor in the site&#8217;s overall architecture, templating system and other variables.<\/p>\r\n\r\n<p>So with flex technology, I was able to knock this out using the three CSS properties provided below:<\/p>\r\n\r\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n\r\n.blog .wrap {\r\n  display: flex;\r\n  flex-flow: wrap;\r\n  flex-direction: column-reverse;\r\n}\r\n\r\n<\/pre>\r\n\r\nPretty sweet. The keyword here is that &#8220;column-reverse&#8221; value assigned to the flex-direction property. With this handy dandy CSS declaration, you can keep your coding to a minimum especially when wrapped in a media query. \r\n\r\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n\r\n@media all and (max-width:800px) {\r\n\r\n  blog .wrap {\r\n    display: flex;\r\n    flex-flow: wrap;\r\n    flex-direction: column-reverse;\r\n  }\r\n\r\n}\r\n\r\n<\/pre>\r\n\r\n<p>No fall back needed here since you are targeting mobile devices, which in my experience handles a majority of modern CSS rules.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m actually not very well versed with using Flex (I definitely should though of course), I really only use it when absolutely necessary &#8211; usually as a fall back plan or when I want to adjust a few elements on mobile. That&#8217;s what this post is really about &#8211; Flex and how it saved me &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.projectimmerse.com\/blog\/mobile-stacking-order-using-flex\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Mobile Stacking Order using Flex&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":1108,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[57],"tags":[],"class_list":["post-565","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-development"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Mobile Stacking Order using Flex - Project Immerse<\/title>\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.projectimmerse.com\/blog\/mobile-stacking-order-using-flex\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Mobile Stacking Order using Flex - Project Immerse\" \/>\n<meta property=\"og:description\" content=\"I&#8217;m actually not very well versed with using Flex (I definitely should though of course), I really only use it when absolutely necessary &#8211; usually as a fall back plan or when I want to adjust a few elements on mobile. That&#8217;s what this post is really about &#8211; Flex and how it saved me &hellip; Continue reading &quot;Mobile Stacking Order using Flex&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.projectimmerse.com\/blog\/mobile-stacking-order-using-flex\/\" \/>\n<meta property=\"og:site_name\" content=\"Project Immerse\" \/>\n<meta property=\"article:published_time\" content=\"2019-05-10T02:02:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-08-01T02:13:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.projectimmerse.com\/blog\/wp-content\/uploads\/2019\/05\/mobile-stacking-order-css-flex.png\" \/>\n\t<meta property=\"og:image:width\" content=\"750\" \/>\n\t<meta property=\"og:image:height\" content=\"750\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Alex Mercer\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alex Mercer\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/mobile-stacking-order-using-flex\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/mobile-stacking-order-using-flex\\\/\"},\"author\":{\"name\":\"Alex Mercer\",\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/#\\\/schema\\\/person\\\/c53f2864be524ee6fa08a7e4800dd1e5\"},\"headline\":\"Mobile Stacking Order using Flex\",\"datePublished\":\"2019-05-10T02:02:41+00:00\",\"dateModified\":\"2026-08-01T02:13:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/mobile-stacking-order-using-flex\\\/\"},\"wordCount\":277,\"image\":{\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/mobile-stacking-order-using-flex\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/05\\\/mobile-stacking-order-css-flex.png\",\"articleSection\":[\"Web Development\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/mobile-stacking-order-using-flex\\\/\",\"url\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/mobile-stacking-order-using-flex\\\/\",\"name\":\"Mobile Stacking Order using Flex - Project Immerse\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/mobile-stacking-order-using-flex\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/mobile-stacking-order-using-flex\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/05\\\/mobile-stacking-order-css-flex.png\",\"datePublished\":\"2019-05-10T02:02:41+00:00\",\"dateModified\":\"2026-08-01T02:13:03+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/#\\\/schema\\\/person\\\/c53f2864be524ee6fa08a7e4800dd1e5\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/mobile-stacking-order-using-flex\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/mobile-stacking-order-using-flex\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/mobile-stacking-order-using-flex\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/05\\\/mobile-stacking-order-css-flex.png\",\"contentUrl\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/05\\\/mobile-stacking-order-css-flex.png\",\"width\":750,\"height\":750,\"caption\":\"Mobile Stacking Order - CSS Flex\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/mobile-stacking-order-using-flex\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Mobile Stacking Order using Flex\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/\",\"name\":\"Project Immerse\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/#\\\/schema\\\/person\\\/c53f2864be524ee6fa08a7e4800dd1e5\",\"name\":\"Alex Mercer\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/alex-mercer-author-150x150.png\",\"url\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/alex-mercer-author-150x150.png\",\"contentUrl\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/alex-mercer-author-150x150.png\",\"caption\":\"Alex Mercer\"},\"description\":\"Alex Mercer is a writer and contributor at Project Immerse, covering web design, WordPress, web development, SEO, digital strategy, emerging technology, and the evolving world of the web. His work focuses on practical ideas, useful tools, and approachable guidance that help creators, developers, and business owners build better digital experiences. Alex writes with a hands-on, curiosity-driven approach, exploring both established web practices and new technologies shaping how websites are designed, built, and discovered.\",\"sameAs\":[\"https:\\\/\\\/www.projectimmerse.com\"],\"url\":\"https:\\\/\\\/www.projectimmerse.com\\\/blog\\\/author\\\/projectimmerse\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Mobile Stacking Order using Flex - Project Immerse","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.projectimmerse.com\/blog\/mobile-stacking-order-using-flex\/","og_locale":"en_US","og_type":"article","og_title":"Mobile Stacking Order using Flex - Project Immerse","og_description":"I&#8217;m actually not very well versed with using Flex (I definitely should though of course), I really only use it when absolutely necessary &#8211; usually as a fall back plan or when I want to adjust a few elements on mobile. That&#8217;s what this post is really about &#8211; Flex and how it saved me &hellip; Continue reading \"Mobile Stacking Order using Flex\"","og_url":"https:\/\/www.projectimmerse.com\/blog\/mobile-stacking-order-using-flex\/","og_site_name":"Project Immerse","article_published_time":"2019-05-10T02:02:41+00:00","article_modified_time":"2026-08-01T02:13:03+00:00","og_image":[{"width":750,"height":750,"url":"https:\/\/www.projectimmerse.com\/blog\/wp-content\/uploads\/2019\/05\/mobile-stacking-order-css-flex.png","type":"image\/png"}],"author":"Alex Mercer","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Alex Mercer","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.projectimmerse.com\/blog\/mobile-stacking-order-using-flex\/#article","isPartOf":{"@id":"https:\/\/www.projectimmerse.com\/blog\/mobile-stacking-order-using-flex\/"},"author":{"name":"Alex Mercer","@id":"https:\/\/www.projectimmerse.com\/blog\/#\/schema\/person\/c53f2864be524ee6fa08a7e4800dd1e5"},"headline":"Mobile Stacking Order using Flex","datePublished":"2019-05-10T02:02:41+00:00","dateModified":"2026-08-01T02:13:03+00:00","mainEntityOfPage":{"@id":"https:\/\/www.projectimmerse.com\/blog\/mobile-stacking-order-using-flex\/"},"wordCount":277,"image":{"@id":"https:\/\/www.projectimmerse.com\/blog\/mobile-stacking-order-using-flex\/#primaryimage"},"thumbnailUrl":"https:\/\/www.projectimmerse.com\/blog\/wp-content\/uploads\/2019\/05\/mobile-stacking-order-css-flex.png","articleSection":["Web Development"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.projectimmerse.com\/blog\/mobile-stacking-order-using-flex\/","url":"https:\/\/www.projectimmerse.com\/blog\/mobile-stacking-order-using-flex\/","name":"Mobile Stacking Order using Flex - Project Immerse","isPartOf":{"@id":"https:\/\/www.projectimmerse.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.projectimmerse.com\/blog\/mobile-stacking-order-using-flex\/#primaryimage"},"image":{"@id":"https:\/\/www.projectimmerse.com\/blog\/mobile-stacking-order-using-flex\/#primaryimage"},"thumbnailUrl":"https:\/\/www.projectimmerse.com\/blog\/wp-content\/uploads\/2019\/05\/mobile-stacking-order-css-flex.png","datePublished":"2019-05-10T02:02:41+00:00","dateModified":"2026-08-01T02:13:03+00:00","author":{"@id":"https:\/\/www.projectimmerse.com\/blog\/#\/schema\/person\/c53f2864be524ee6fa08a7e4800dd1e5"},"breadcrumb":{"@id":"https:\/\/www.projectimmerse.com\/blog\/mobile-stacking-order-using-flex\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.projectimmerse.com\/blog\/mobile-stacking-order-using-flex\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.projectimmerse.com\/blog\/mobile-stacking-order-using-flex\/#primaryimage","url":"https:\/\/www.projectimmerse.com\/blog\/wp-content\/uploads\/2019\/05\/mobile-stacking-order-css-flex.png","contentUrl":"https:\/\/www.projectimmerse.com\/blog\/wp-content\/uploads\/2019\/05\/mobile-stacking-order-css-flex.png","width":750,"height":750,"caption":"Mobile Stacking Order - CSS Flex"},{"@type":"BreadcrumbList","@id":"https:\/\/www.projectimmerse.com\/blog\/mobile-stacking-order-using-flex\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.projectimmerse.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Mobile Stacking Order using Flex"}]},{"@type":"WebSite","@id":"https:\/\/www.projectimmerse.com\/blog\/#website","url":"https:\/\/www.projectimmerse.com\/blog\/","name":"Project Immerse","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.projectimmerse.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.projectimmerse.com\/blog\/#\/schema\/person\/c53f2864be524ee6fa08a7e4800dd1e5","name":"Alex Mercer","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.projectimmerse.com\/blog\/wp-content\/uploads\/2026\/09\/alex-mercer-author-150x150.png","url":"https:\/\/www.projectimmerse.com\/blog\/wp-content\/uploads\/2026\/09\/alex-mercer-author-150x150.png","contentUrl":"https:\/\/www.projectimmerse.com\/blog\/wp-content\/uploads\/2026\/09\/alex-mercer-author-150x150.png","caption":"Alex Mercer"},"description":"Alex Mercer is a writer and contributor at Project Immerse, covering web design, WordPress, web development, SEO, digital strategy, emerging technology, and the evolving world of the web. His work focuses on practical ideas, useful tools, and approachable guidance that help creators, developers, and business owners build better digital experiences. Alex writes with a hands-on, curiosity-driven approach, exploring both established web practices and new technologies shaping how websites are designed, built, and discovered.","sameAs":["https:\/\/www.projectimmerse.com"],"url":"https:\/\/www.projectimmerse.com\/blog\/author\/projectimmerse\/"}]}},"_links":{"self":[{"href":"https:\/\/www.projectimmerse.com\/blog\/wp-json\/wp\/v2\/posts\/565","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.projectimmerse.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.projectimmerse.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.projectimmerse.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.projectimmerse.com\/blog\/wp-json\/wp\/v2\/comments?post=565"}],"version-history":[{"count":7,"href":"https:\/\/www.projectimmerse.com\/blog\/wp-json\/wp\/v2\/posts\/565\/revisions"}],"predecessor-version":[{"id":573,"href":"https:\/\/www.projectimmerse.com\/blog\/wp-json\/wp\/v2\/posts\/565\/revisions\/573"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.projectimmerse.com\/blog\/wp-json\/wp\/v2\/media\/1108"}],"wp:attachment":[{"href":"https:\/\/www.projectimmerse.com\/blog\/wp-json\/wp\/v2\/media?parent=565"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.projectimmerse.com\/blog\/wp-json\/wp\/v2\/categories?post=565"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.projectimmerse.com\/blog\/wp-json\/wp\/v2\/tags?post=565"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}