Dessinez la vue 3D des codes suivants
Dessinez la vue 3D des codes suivants
html | css |
<section> <div class="A">item 1</div> <div class="B">item 2</div> <div class="C">item 3</div> </section> | section>div:nth-child(1) { } section>div:nth-child(2) { position: absolute; } section>div:nth-child(3) { position:relative; } |
html | css |
<section> <div class="A"> <p>AAAAAA</p> </div> <div class="B"> <p>BBBBBB</p> </div> <div class="C"> <p>CCCCCC</p> </div> </section> | section { position: relative; width: 30vw; } section>div:nth-child(2) { z-index: 1; position: absolute; } section>div:nth-child(3) { z-index:2; position:relative; } div { position: relative; } |
html | css |
<section> <div class="A"> <p>AAAAAA</p> </div> <div class="B"> <p class="alert">BBBBBB</p> </div> <div class="C"> <p>CCCCCC</p> </div> </section> | p.alert { z-index:1000; position:relative; } section { position: relative; width: 30vw; } section>div:nth-child(1) { } section>div:nth-child(2) { z-index: 1; position: absolute; } section>div:nth-child(3) { z-index:2; position:relative; background: black; color: white; } div { position: relative; } p { margin:0; } |