Intro_basicos_HTML_CSS/CursoHTML/css/zindex.css
2020-11-18 01:21:49 -03:00

32 lines
485 B
CSS
Executable File

/* Z-Indez = indice de profundidad */
body {
font-family: arial, helvetica, sans-serif;
}
div {
width: 200px;
height: 150px;
padding: 20px;
position: absolute; /* para usar el z index todos los elementos deben tener el mismo tipo de position*/
}
#div1 {
background: #FC0;
top: 0;
left: 0;
z-index: 10;
}
#div2 {
background: #0FC;
top: 50px;
left: 50px;
z-index: 20;
}
#div3 {
background: #AE0;
top: 100px;
left: 100px;
z-index: 30;
}