{"id":63071,"date":"2019-04-04T04:15:33","date_gmt":"2019-04-04T11:15:33","guid":{"rendered":"http:\/\/www.taterboy.com\/blog\/2019\/04\/managing-z-index-in-a-component-based-web-application\/"},"modified":"2019-04-04T04:15:33","modified_gmt":"2019-04-04T11:15:33","slug":"managing-z-index-in-a-component-based-web-application","status":"publish","type":"post","link":"https:\/\/www.taterboy.com\/blog\/2019\/04\/managing-z-index-in-a-component-based-web-application\/","title":{"rendered":"Managing Z-Index In A Component-Based Web Application"},"content":{"rendered":"<link rel=\"canonical\" href=\"https:\/\/www.smashingmagazine.com\/2019\/04\/z-index-component-based-web-application\/\"><title>Managing Z-Index In A Component-Based Web Application<\/title><\/p>\n<article>\n<header>\n<h1>Managing Z-Index In A Component-Based Web Application<\/h1>\n<address>Pavel Pomerantsev<\/address>\n<p>                  <time datetime=\"2019-04-03T14:00:08+02:00\">2019-04-03T14:00:08+02:00<\/time><time datetime=\"2019-04-04T11:05:31+00:00\">2019-04-04T11:05:31+00:00<\/time><\/header>\n<p>If you\u2019ve done any complex web UI development, you must have at least once furiously tried driving an element\u2019s <code>z-index<\/code> up to thousands, only to see that it\u2019s not helping position it on top of some other element, whose <code>z-index<\/code> is lower or even not defined at all.<\/p>\n<p>Why does that happen? And more importantly, how to avoid such issues?<\/p>\n<p>In this article, I\u2019ll recap what <code>z-index<\/code> actually is and how you can stop guessing whether it might work in any specific case and start treating it just like any other convenient tool.<\/p>\n<h3>The Hierarchy Of Stacking Contexts<\/h3>\n<p>If you imagine the webpage as having three dimensions, then <code>z-index<\/code> is a property that defines the <code>z<\/code> coordinate of an element (also called its \u201cstacking order\u201d): the larger the value, the closer the element is to the observer. You can also think of it as a property affecting paint order, and this will in fact be more correct since the screen is a two-dimensional grid of pixels. So, the larger the <code>z-index<\/code> value, the later the element is painted on the page.<\/p>\n<p>There is, however, one major complication. The <code>z-index<\/code> value space is not flat \u2014 it\u2019s hierarchical. An element can create a stacking context which becomes the root for <code>z-index<\/code> values of its descendants. It would be best to explain the concept of stacking contexts by using an example.<\/p>\n<div data-component=\"FeaturePanel\" data-audience=\"non-subscriber\" data-remove=\"true\"><\/div>\n<p>The document body has five <code>div<\/code> descendants: <code>div1<\/code>, <code>div2<\/code>, <code>div3<\/code>, <code>div1-1<\/code>, and <code>div2-1<\/code>. They\u2019re all absolutely positioned and overlap with each other. <code>div1-1<\/code> is a child of <code>div1<\/code>, and <code>div2-1<\/code> is a child of <code>div2<\/code>.<\/p>\n<p data-height=\"500\" data-theme-id=\"light\" data-slug-hash=\"bJEmvG\" data-user=\"smashingmag\" data-default-tab=\"result\">See the Pen <a href=\"https:\/\/codepen.io\/smashingmag\/pen\/bJEmvG\/\">stacking-contexts<\/a> by <a href=\"https:\/\/codepen.io\/pavelp\">Pavel Pomerantsev<\/a>.<\/p>\n<p>Let\u2019s try to understand why we see what we see. There are quite elaborate <a href=\"https:\/\/www.w3.org\/TR\/CSS2\/zindex.html\">rules to determine paint order<\/a>, but here we only need to compare two things:<\/p>\n<ul>\n<li><code>z-index<\/code> <strong>Values<\/strong><br \/>\nIf an element has a higher <code>z-index<\/code>, it\u2019s painted later.<\/li>\n<li><strong>Source Order<\/strong><br \/>\nIf <code>z-index<\/code> values are the same, then the later it\u2019s in the source, the later it\u2019s painted.<\/li>\n<\/ul>\n<p>So if we don\u2019t take stacking contexts into account, the order should be as follows:<\/p>\n<ul>\n<li><code>div1<\/code><\/li>\n<li><code>div2<\/code><\/li>\n<li><code>div3<\/code><\/li>\n<li><code>div1-1<\/code><\/li>\n<li><code>div2-1<\/code><\/li>\n<\/ul>\n<p>Note that <code>div2-1<\/code> is in fact overlapped by <code>div3<\/code>. Why is that happening?<\/p>\n<p>If an element is said to create a <strong>stacking context<\/strong>, it creates a basis for its children\u2019s <code>z-index<\/code> values, so they\u2019re never compared with anything outside the stacking context when determining paint order. To put it another way, when an element creating a stacking context is painted, all its children are painted right after it and before any of its siblings.<\/p>\n<p>Going back to the example, the actual paint order of <code>body<\/code>\u2019s descendant divs is:<\/p>\n<ul>\n<li><code>div1<\/code><\/li>\n<li><code>div2<\/code><\/li>\n<li><code>div3<\/code><\/li>\n<li><code>div1-1<\/code><\/li>\n<\/ul>\n<p>Notice the absence of <code>div2-1<\/code> in the list \u2014 it\u2019s a child of <code>div2<\/code> which creates a stacking context (because it\u2019s an absolutely positioned element with a <code>z-index<\/code> other than the default value of <code>auto<\/code>), so it\u2019s painted after <code>div2<\/code>, but before <code>div3<\/code>.<\/p>\n<p><code>div1<\/code> doesn\u2019t create a stacking context, because its implicit <code>z-index<\/code> value is <code>auto<\/code>, so <code>div1-1<\/code> (its child) is painted after <code>div2<\/code> and <code>div3<\/code> (since its <code>z-index<\/code>, 10, is larger than that of <code>div2<\/code> and <code>div3<\/code>).<\/p>\n<p>Don\u2019t worry if you didn\u2019t fully grasp this on first reading. There\u2019s a bunch of online resources that do a great job in explaining these concepts in more detail:<\/p>\n<ul>\n<li>\u201c<a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/CSS_Positioning\/Understanding_z_index\/The_stacking_context\">The Stacking Context<\/a>,\u201d MDN web docs, Mozilla<\/li>\n<li>\u201c<a href=\"https:\/\/philipwalton.com\/articles\/what-no-one-told-you-about-z-index\/\">What No One Told You About Z-Index<\/a>,\u201d Philip Walton<\/li>\n<\/ul>\n<p><strong>Note<\/strong>: <em>It\u2019s also great to be familiar with <a href=\"https:\/\/www.w3.org\/TR\/CSS2\/zindex.html\">general paint order rules<\/a> (which are actually quite complex).<\/em><\/p>\n<div><\/div>\n<p>The main point of this piece, however, is how to deal with <code>z-index<\/code> when your page is composed of dozens and hundreds of components, each potentially having children with <code>z-index<\/code> defined.<\/p>\n<p>One of the most popular articles on <code>z-index<\/code> proposes <a href=\"https:\/\/css-tricks.com\/handling-z-index\/\">grouping all <code>z-index<\/code> values in one place<\/a>, but comparing those values doesn\u2019t make sense if they don\u2019t belong to the same stacking context (which might not be easy to achieve in a large application).<\/p>\n<p>Here\u2019s an example. Let\u2019s say we have a page with header and main sections. The main section for some reason has to have <code>position: relative<\/code> and <code>z-index: 1<\/code>.<\/p>\n<div>\n<p data-height=\"500\" data-theme-id=\"light\" data-slug-hash=\"XQWLLN\" data-user=\"smashingmag\" data-default-tab=\"result\">See the Pen <a href=\"https:\/\/codepen.io\/smashingmag\/pen\/XQWLLN\/\">z-index-step1<\/a> by <a href=\"https:\/\/codepen.io\/pavelp\">Pavel Pomerantsev<\/a>.<\/p>\n<\/div>\n<p>We\u2019re using a component architecture here, so CSS for the root component and every child component is defined in dedicated sections. In practice, components would live in separate files, and the markup would be generated using a JavaScript library of your choice, like React, but for demonstration purposes it\u2019s fine to have everything together.<\/p>\n<p>Now, imagine we\u2019re tasked with creating a dropdown menu in the header. It has to be stacked on top of the main section, of course, so we\u2019ll give it a <code>z-index<\/code> of <code>10<\/code>:<\/p>\n<div>\n<p data-height=\"500\" data-theme-id=\"light\" data-slug-hash=\"VNwJoX\" data-user=\"smashingmag\" data-default-tab=\"result\">See the Pen <a href=\"https:\/\/codepen.io\/smashingmag\/pen\/VNwJoX\/\">z-index-step2<\/a> by <a href=\"https:\/\/codepen.io\/pavelp\">Pavel Pomerantsev<\/a>.<\/p>\n<\/div>\n<p>Now, a few months later, in order to make something unrelated work better, we apply the <a href=\"https:\/\/aerotwist.com\/blog\/on-translate3d-and-layer-creation-hacks\/\"><code>translateZ<\/code><\/a> hack to the header.<\/p>\n<div>\n<p data-height=\"500\" data-theme-id=\"light\" data-slug-hash=\"jROgOE\" data-user=\"smashingmag\" data-default-tab=\"result\">See the Pen <a href=\"https:\/\/codepen.io\/smashingmag\/pen\/jROgOE\/\">z-index-step3<\/a> by <a href=\"https:\/\/codepen.io\/pavelp\">Pavel Pomerantsev<\/a>.<\/p>\n<\/div>\n<p>As you can see, the layout is now broken. An element with <code>z-index: 1<\/code> sits on top of an element with <code>z-index: 10<\/code>, in the absence of any other <code>z-index<\/code> rules. The reason is that the header now creates a stacking context \u2014 it\u2019s an element with a <code>transform<\/code> property whose value is anything other than <code>none<\/code> (<a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/CSS_Positioning\/Understanding_z_index\/The_stacking_context\">see full rules<\/a>) and its own <code>z-index<\/code> (<code>0<\/code> by default) is lower than that of the main section (<code>1<\/code>).<\/p>\n<p>The solution is straightforward: give the header a <code>z-index<\/code> value of <code>2<\/code>, and it\u2019ll be fixed.<\/p>\n<div>\n<p data-height=\"500\" data-theme-id=\"light\" data-slug-hash=\"qwBeEV\" data-user=\"smashingmag\" data-default-tab=\"result\">See the Pen <a href=\"https:\/\/codepen.io\/smashingmag\/pen\/qwBeEV\/\">z-index-step4<\/a> by <a href=\"https:\/\/codepen.io\/pavelp\">Pavel Pomerantsev<\/a>.<\/p>\n<\/div>\n<p>The question is, how are we supposed to come to this solution if we have components within components within components, each having elements with different z-indices? How can we be sure that changing <code>z-index<\/code> of the header won\u2019t break anything else?<\/p>\n<p>The answer is a convention that eliminates the need for guesswork, and it\u2019s the following: changing z-indices within a component <strong>should only affect that component<\/strong>, and nothing else. To put it differently, when dealing with <code>z-index<\/code> values in a certain CSS file, we should ideally only concern ourselves with other values in that same file.<\/p>\n<p>Achieving it is easy. We should simply make sure that the root of every component creates a stacking context. The easiest way to do it is to give it <code>position<\/code> and <code>z-index<\/code> values other than the default ones (which are <code>static<\/code> and <code>auto<\/code>, respectively).<\/p>\n<p>Here\u2019s one of the ways to structure the application. It uses more elements than the previous one, but computation associated with extra DOM elements is cheap whereas developer\u2019s time (a lot of which can sometimes be spent on debugging stacking issues) is definitely not.<\/p>\n<div>\n<p data-height=\"500\" data-theme-id=\"light\" data-slug-hash=\"gyOVpq\" data-user=\"smashingmag\" data-default-tab=\"result\">See the Pen <a href=\"https:\/\/codepen.io\/smashingmag\/pen\/gyOVpq\/\">z-index-step5<\/a> by <a href=\"https:\/\/codepen.io\/pavelp\">Pavel Pomerantsev<\/a>.<\/p>\n<\/div>\n<ul>\n<li><code>header__container<\/code> and <code>main__container<\/code> both have <code>position: relative<\/code> and <code>z-index: 0<\/code>;<\/li>\n<li><code>header__overlay<\/code> now has <code>z-index: 1<\/code> (we don\u2019t need a large value since it\u2019s only going to compete for stacking order with other elements within the header);<\/li>\n<li><code>root__header<\/code> now has <code>z-index: 2<\/code>, whereas <code>root__main<\/code> keeps its <code>z-index: 1<\/code>, and this is what makes the two siblings stack correctly.<\/li>\n<\/ul>\n<p>(Note also that both have <code>position: relative<\/code> since <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/z-index\"><code>z-index<\/code> doesn\u2019t apply to statically positioned elements<\/a>.)<\/p>\n<div><\/div>\n<p>If we look at the header code now, we\u2019ll notice that we can remove the <code>z-index<\/code> property from both the container and the overlay altogether because <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/CSS_Positioning\/Understanding_z_index\/Stacking_without_z-index\">the overlay is the only positioned element<\/a> there. Likewise, the <code>z-index<\/code> is not required on the main container. This is the biggest benefit of the proposed approach: when looking at z-indices, it\u2019s only the component itself that matters, not its context.<\/p>\n<div>\n<p data-height=\"500\" data-theme-id=\"light\" data-slug-hash=\"WWNVwN\" data-user=\"smashingmag\" data-default-tab=\"result\">See the Pen <a href=\"https:\/\/codepen.io\/smashingmag\/pen\/WWNVwN\/\">z-index-step6<\/a> by <a href=\"https:\/\/codepen.io\/pavelp\">Pavel Pomerantsev<\/a>.<\/p>\n<\/div>\n<p>Such an architecture is not without its drawbacks. It makes the application more predictable at the expense of some flexibility. For example, you won\u2019t be able to create such overlays inside both the header and the main section:<\/p>\n<div>\n<p data-height=\"500\" data-theme-id=\"light\" data-slug-hash=\"GLRVqz\" data-user=\"smashingmag\" data-default-tab=\"result\">See the Pen <a href=\"https:\/\/codepen.io\/smashingmag\/pen\/GLRVqz\/\">z-index-step7<\/a> by <a href=\"https:\/\/codepen.io\/pavelp\">Pavel Pomerantsev<\/a>.<\/p>\n<\/div>\n<p>In my experience, however, this is rarely a problem. You could make the overlay in the main section go down instead of up, in order for it to not intersect with the header. Or, if you really needed it to go up, you could inject the overlay HTML at the end of the body and give it a large <code>z-index<\/code> (\u201clarge\u201d being whatever\u2019s larger than those of other sections at the top level). In any case, if you\u2019re not in a competition to build the most complicated layout, you should be fine.<\/p>\n<p>To recap:<\/p>\n<ul>\n<li><strong>Isolate components<\/strong> in terms of <code>z-index<\/code> values of elements by making the root of each component a stacking context;<\/li>\n<li>You don\u2019t have to do it if no element within a component needs a <code>z-index<\/code> value other than <code>auto<\/code>;<\/li>\n<li>Within a component\u2019s CSS file, <strong>maintain<\/strong> <code>z-index<\/code> <strong>values any way you like<\/strong>. It might be consecutive values, or you could give them a step of 10, or you can use variables \u2014 it all depends on your project\u2019s conventions and the size of the component (although making components smaller is never a bad thing). Preferably, only assign <code>z-index<\/code> to sibling elements. Otherwise, you may inadvertently introduce more stacking contexts within a component, and you\u2019re faced with the same issue again, luckily on a smaller scale;<\/li>\n<li><strong>Debugging becomes easy<\/strong>. Find the first ancestor component of the two elements that are not stacked correctly, and change z-indices within that component as necessary.<\/li>\n<\/ul>\n<p>This approach will hopefully bring back some sanity to your development process.<\/p>\n<div>\n  <img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/04\/logo-red-2.png?w=900\" alt=\"Smashing Editorial\"><span>(dm, ra, il)<\/span>\n<\/div>\n<\/article>\n<p class=\"wpematico_credit\"><small>Powered by <a href=\"http:\/\/www.wpematico.com\" target=\"_blank\">WPeMatico<\/a><\/small><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Managing Z-Index In A Component-Based Web Application Managing Z-Index In A Component-Based Web Application Pavel Pomerantsev 2019-04-03T14:00:08+02:002019-04-04T11:05:31+00:00 If you\u2019ve done any complex web UI development, you must have at least once furiously tried driving an element\u2019s z-index up to thousands, only to see that it\u2019s not helping position it on top of some other element,&#8230;<a class=\"moretag\" href=\"https:\/\/www.taterboy.com\/blog\/2019\/04\/managing-z-index-in-a-component-based-web-application\/\"> Read the full article&#8230;<\/a><\/p>\n","protected":false},"author":4,"featured_media":63072,"comment_status":"closed","ping_status":"closed","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_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[371],"tags":[],"class_list":["post-63071","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-user-experience"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"Managing Z-Index In A Component-Based Web ApplicationManaging Z-Index In A Component-Based Web Application Pavel Pomerantsev 2019-04-03T14:00:08+02:002019-04-04T11:05:31+00:00If you\u2019ve done any complex web UI development, you must have at least once furiously tried driving an element\u2019s z-index up to thousands, only to see that it\u2019s not helping position it on top of some other element, whose z-index\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Guest Contribution\"\/>\n\t<meta name=\"keywords\" content=\"user experience\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.taterboy.com\/blog\/2019\/04\/managing-z-index-in-a-component-based-web-application\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Design for Immersive Technologies | User Experience for Games, Virtual Reality (VR) and Augmented\/Mixed Reality (AR\/MR)\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Managing Z-Index In A Component-Based Web Application | Design for Immersive Technologies\" \/>\n\t\t<meta property=\"og:description\" content=\"Managing Z-Index In A Component-Based Web ApplicationManaging Z-Index In A Component-Based Web Application Pavel Pomerantsev 2019-04-03T14:00:08+02:002019-04-04T11:05:31+00:00If you\u2019ve done any complex web UI development, you must have at least once furiously tried driving an element\u2019s z-index up to thousands, only to see that it\u2019s not helping position it on top of some other element, whose z-index\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.taterboy.com\/blog\/2019\/04\/managing-z-index-in-a-component-based-web-application\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-04-04T11:15:33+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2019-04-04T11:15:33+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Managing Z-Index In A Component-Based Web Application | Design for Immersive Technologies\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Managing Z-Index In A Component-Based Web ApplicationManaging Z-Index In A Component-Based Web Application Pavel Pomerantsev 2019-04-03T14:00:08+02:002019-04-04T11:05:31+00:00If you\u2019ve done any complex web UI development, you must have at least once furiously tried driving an element\u2019s z-index up to thousands, only to see that it\u2019s not helping position it on top of some other element, whose z-index\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/04\\\/managing-z-index-in-a-component-based-web-application\\\/#article\",\"name\":\"Managing Z-Index In A Component-Based Web Application | Design for Immersive Technologies\",\"headline\":\"Managing Z-Index In A Component-Based Web Application\",\"author\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.taterboy.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/04\\\/logo-red-2.png?fit=60%2C80&ssl=1\",\"width\":60,\"height\":80},\"datePublished\":\"2019-04-04T04:15:33-07:00\",\"dateModified\":\"2019-04-04T04:15:33-07:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/04\\\/managing-z-index-in-a-component-based-web-application\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/04\\\/managing-z-index-in-a-component-based-web-application\\\/#webpage\"},\"articleSection\":\"User Experience\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/04\\\/managing-z-index-in-a-component-based-web-application\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.taterboy.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/category\\\/user-experience\\\/#listItem\",\"name\":\"User Experience\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/category\\\/user-experience\\\/#listItem\",\"position\":2,\"name\":\"User Experience\",\"item\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/category\\\/user-experience\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/04\\\/managing-z-index-in-a-component-based-web-application\\\/#listItem\",\"name\":\"Managing Z-Index In A Component-Based Web Application\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/04\\\/managing-z-index-in-a-component-based-web-application\\\/#listItem\",\"position\":3,\"name\":\"Managing Z-Index In A Component-Based Web Application\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/category\\\/user-experience\\\/#listItem\",\"name\":\"User Experience\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#organization\",\"name\":\"Design for Immersive Technologies\",\"description\":\"User Experience for Games, Virtual Reality (VR) and Augmented\\\/Mixed Reality (AR\\\/MR)\",\"url\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/#author\",\"url\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/\",\"name\":\"Guest Contribution\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/04\\\/managing-z-index-in-a-component-based-web-application\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d2aad73eb0f48c67b141e9fc978a0e498969791ed623346e361d02d19775b0bb?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Guest Contribution\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/04\\\/managing-z-index-in-a-component-based-web-application\\\/#webpage\",\"url\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/04\\\/managing-z-index-in-a-component-based-web-application\\\/\",\"name\":\"Managing Z-Index In A Component-Based Web Application | Design for Immersive Technologies\",\"description\":\"Managing Z-Index In A Component-Based Web ApplicationManaging Z-Index In A Component-Based Web Application Pavel Pomerantsev 2019-04-03T14:00:08+02:002019-04-04T11:05:31+00:00If you\\u2019ve done any complex web UI development, you must have at least once furiously tried driving an element\\u2019s z-index up to thousands, only to see that it\\u2019s not helping position it on top of some other element, whose z-index\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/04\\\/managing-z-index-in-a-component-based-web-application\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.taterboy.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/04\\\/logo-red-2.png?fit=60%2C80&ssl=1\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/04\\\/managing-z-index-in-a-component-based-web-application\\\/#mainImage\",\"width\":60,\"height\":80},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/04\\\/managing-z-index-in-a-component-based-web-application\\\/#mainImage\"},\"datePublished\":\"2019-04-04T04:15:33-07:00\",\"dateModified\":\"2019-04-04T04:15:33-07:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/\",\"name\":\"Design for Immersive Technologies\",\"description\":\"User Experience for Games, Virtual Reality (VR) and Augmented\\\/Mixed Reality (AR\\\/MR)\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Managing Z-Index In A Component-Based Web Application | Design for Immersive Technologies","description":"Managing Z-Index In A Component-Based Web ApplicationManaging Z-Index In A Component-Based Web Application Pavel Pomerantsev 2019-04-03T14:00:08+02:002019-04-04T11:05:31+00:00If you\u2019ve done any complex web UI development, you must have at least once furiously tried driving an element\u2019s z-index up to thousands, only to see that it\u2019s not helping position it on top of some other element, whose z-index","canonical_url":"https:\/\/www.taterboy.com\/blog\/2019\/04\/managing-z-index-in-a-component-based-web-application\/","robots":"max-image-preview:large","keywords":"user experience","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.taterboy.com\/blog\/2019\/04\/managing-z-index-in-a-component-based-web-application\/#article","name":"Managing Z-Index In A Component-Based Web Application | Design for Immersive Technologies","headline":"Managing Z-Index In A Component-Based Web Application","author":{"@id":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/#author"},"publisher":{"@id":"https:\/\/www.taterboy.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/04\/logo-red-2.png?fit=60%2C80&ssl=1","width":60,"height":80},"datePublished":"2019-04-04T04:15:33-07:00","dateModified":"2019-04-04T04:15:33-07:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.taterboy.com\/blog\/2019\/04\/managing-z-index-in-a-component-based-web-application\/#webpage"},"isPartOf":{"@id":"https:\/\/www.taterboy.com\/blog\/2019\/04\/managing-z-index-in-a-component-based-web-application\/#webpage"},"articleSection":"User Experience"},{"@type":"BreadcrumbList","@id":"https:\/\/www.taterboy.com\/blog\/2019\/04\/managing-z-index-in-a-component-based-web-application\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.taterboy.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/category\/user-experience\/#listItem","name":"User Experience"}},{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/category\/user-experience\/#listItem","position":2,"name":"User Experience","item":"https:\/\/www.taterboy.com\/blog\/category\/user-experience\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/2019\/04\/managing-z-index-in-a-component-based-web-application\/#listItem","name":"Managing Z-Index In A Component-Based Web Application"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/2019\/04\/managing-z-index-in-a-component-based-web-application\/#listItem","position":3,"name":"Managing Z-Index In A Component-Based Web Application","previousItem":{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/category\/user-experience\/#listItem","name":"User Experience"}}]},{"@type":"Organization","@id":"https:\/\/www.taterboy.com\/blog\/#organization","name":"Design for Immersive Technologies","description":"User Experience for Games, Virtual Reality (VR) and Augmented\/Mixed Reality (AR\/MR)","url":"https:\/\/www.taterboy.com\/blog\/"},{"@type":"Person","@id":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/#author","url":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/","name":"Guest Contribution","image":{"@type":"ImageObject","@id":"https:\/\/www.taterboy.com\/blog\/2019\/04\/managing-z-index-in-a-component-based-web-application\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/d2aad73eb0f48c67b141e9fc978a0e498969791ed623346e361d02d19775b0bb?s=96&d=mm&r=g","width":96,"height":96,"caption":"Guest Contribution"}},{"@type":"WebPage","@id":"https:\/\/www.taterboy.com\/blog\/2019\/04\/managing-z-index-in-a-component-based-web-application\/#webpage","url":"https:\/\/www.taterboy.com\/blog\/2019\/04\/managing-z-index-in-a-component-based-web-application\/","name":"Managing Z-Index In A Component-Based Web Application | Design for Immersive Technologies","description":"Managing Z-Index In A Component-Based Web ApplicationManaging Z-Index In A Component-Based Web Application Pavel Pomerantsev 2019-04-03T14:00:08+02:002019-04-04T11:05:31+00:00If you\u2019ve done any complex web UI development, you must have at least once furiously tried driving an element\u2019s z-index up to thousands, only to see that it\u2019s not helping position it on top of some other element, whose z-index","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.taterboy.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.taterboy.com\/blog\/2019\/04\/managing-z-index-in-a-component-based-web-application\/#breadcrumblist"},"author":{"@id":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/#author"},"creator":{"@id":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/#author"},"image":{"@type":"ImageObject","url":"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/04\/logo-red-2.png?fit=60%2C80&ssl=1","@id":"https:\/\/www.taterboy.com\/blog\/2019\/04\/managing-z-index-in-a-component-based-web-application\/#mainImage","width":60,"height":80},"primaryImageOfPage":{"@id":"https:\/\/www.taterboy.com\/blog\/2019\/04\/managing-z-index-in-a-component-based-web-application\/#mainImage"},"datePublished":"2019-04-04T04:15:33-07:00","dateModified":"2019-04-04T04:15:33-07:00"},{"@type":"WebSite","@id":"https:\/\/www.taterboy.com\/blog\/#website","url":"https:\/\/www.taterboy.com\/blog\/","name":"Design for Immersive Technologies","description":"User Experience for Games, Virtual Reality (VR) and Augmented\/Mixed Reality (AR\/MR)","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.taterboy.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Design for Immersive Technologies | User Experience for Games, Virtual Reality (VR) and Augmented\/Mixed Reality (AR\/MR)","og:type":"article","og:title":"Managing Z-Index In A Component-Based Web Application | Design for Immersive Technologies","og:description":"Managing Z-Index In A Component-Based Web ApplicationManaging Z-Index In A Component-Based Web Application Pavel Pomerantsev 2019-04-03T14:00:08+02:002019-04-04T11:05:31+00:00If you\u2019ve done any complex web UI development, you must have at least once furiously tried driving an element\u2019s z-index up to thousands, only to see that it\u2019s not helping position it on top of some other element, whose z-index","og:url":"https:\/\/www.taterboy.com\/blog\/2019\/04\/managing-z-index-in-a-component-based-web-application\/","article:published_time":"2019-04-04T11:15:33+00:00","article:modified_time":"2019-04-04T11:15:33+00:00","twitter:card":"summary","twitter:title":"Managing Z-Index In A Component-Based Web Application | Design for Immersive Technologies","twitter:description":"Managing Z-Index In A Component-Based Web ApplicationManaging Z-Index In A Component-Based Web Application Pavel Pomerantsev 2019-04-03T14:00:08+02:002019-04-04T11:05:31+00:00If you\u2019ve done any complex web UI development, you must have at least once furiously tried driving an element\u2019s z-index up to thousands, only to see that it\u2019s not helping position it on top of some other element, whose z-index"},"aioseo_meta_data":{"post_id":"63071","title":null,"description":null,"keywords":null,"keyphrases":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_custom_url":null,"og_image_custom_fields":null,"og_custom_image_width":null,"og_custom_image_height":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"created":"2021-02-07 21:11:28","updated":"2026-09-01 07:56:41","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"primary_term":null,"og_image_url":null,"og_image_width":null,"og_image_height":null,"twitter_image_url":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"limit_modified_date":false,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.taterboy.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.taterboy.com\/blog\/category\/user-experience\/\" title=\"User Experience\">User Experience<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tManaging Z-Index In A Component-Based Web Application\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.taterboy.com\/blog"},{"label":"User Experience","link":"https:\/\/www.taterboy.com\/blog\/category\/user-experience\/"},{"label":"Managing Z-Index In A Component-Based Web Application","link":"https:\/\/www.taterboy.com\/blog\/2019\/04\/managing-z-index-in-a-component-based-web-application\/"}],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8wzr5-gph","jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/04\/logo-red-2.png?fit=60%2C80&ssl=1","_links":{"self":[{"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/posts\/63071","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/comments?post=63071"}],"version-history":[{"count":0,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/posts\/63071\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/media\/63072"}],"wp:attachment":[{"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/media?parent=63071"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/categories?post=63071"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/tags?post=63071"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}