- index.html
- style.css
HTML
<!DOCTYPE html>
<html lang="es">
<head>
<title>Centrado con transform: translate</title>
<meta charset="utf-8">
<link rel="stylesheet" href="world.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="world homeworld">
<div class="picture-frame large active">
<div class="picture"></div>
</div>
</div>
</body>
</html>
CSS
.picture {
position: relative;
width: 50%;
height: 50%;
}
Ha ido a otra página
ObjetivosRealizado
0
- Asigna
left: 50%al bloque.picture. - Añade
top: 50%. - Después desplázalo
-50%contranslateX. - Desplázalo también
-50%contranslateY.