Skip to content

Instantly share code, notes, and snippets.

@k-fish
Created March 26, 2019 14:56
Show Gist options
  • Save k-fish/c31ff7746b34d8df6f6473407255a3b7 to your computer and use it in GitHub Desktop.
Save k-fish/c31ff7746b34d8df6f6473407255a3b7 to your computer and use it in GitHub Desktop.
z-index dom order
<h1>Z-index Dom Order Example</h1>
<br>
<br>
<Card as |card|>
<h2>Both 'z-index=100'</h2>
<div style="height: 100px"></div>
<Circle style="position:absolute; z-index: 100"/>
<Square style="position:absolute; z-index: 100"/>
<h3>Second Component on top</h3>
</Card>
<Card as |card|>
<h2>Both 'z-index=100'</h2>
<div style="height: 100px"></div>
<Square style="position:absolute; z-index: 100"/>
<Circle style="position:absolute; z-index: 100"/>
<h3>Second Component on top (reversed order)</h3>
</Card>
<br>
<br>
<div style="margin: 10px; border: 1px solid #aaa; padding: 20px; border-radius: 5px; display: flex; align-items: center; justify-content: center; flex-direction:column;">
{{yield}}
</div>
<div style="width: 100px; height:100px; border-radius:50%; background-color:rgba(255,0,0,1);"></div>
<div style="width: 100px; height:100px; background-color:rgba(0,0,255,0.5)"></div>
{
"version": "0.15.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js",
"ember": "3.4.3",
"ember-template-compiler": "3.4.3",
"ember-testing": "3.4.3"
},
"addons": {
"ember-data": "3.4.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment