Exécuter
❯
Exécuter le code
Ctrl+Alt+R
Enregistrer le code
Ctrl+Alt+A
Changer d'orientation
Ctrl+Alt+O
Changer de thème
Ctrl+Alt+D
<!DOCTYPE html> <html> <head> <style> .container { position: relative; } .black-box { position: relative; bordure: 2px solide noir; hauteur: 100px; marge: 30px; } .gray-box { position: absolute; arrière-plan: gris clair; hauteur: 60px; largeur: 70%; gauche: 50px; haut: 50px; } .green-box { position: absolute; arrière-plan: vert clair; largeur: 35%; gauche: 270px; haut: -15px; hauteur: 100px; } </style> </head> <body> <h1>Éléments superposés sans z-index</h1> <p>If two positioned elements overlap each other without a z-index specified, the elements render in the order they are defined in the HTML source code:</p> <div class="container"> <div class="black-box">Boîte noire</div> <div class="gray-box">
Boîte grise
</div> <div class="green-box">
Boîte verte
</div> </div> </body> </html>