Skip to content

Instantly share code, notes, and snippets.

@kurotori
Created June 10, 2025 12:08
Show Gist options
  • Save kurotori/020abd7bed4eaf84b68e202f1fdbbf61 to your computer and use it in GitHub Desktop.
Save kurotori/020abd7bed4eaf84b68e202f1fdbbf61 to your computer and use it in GitHub Desktop.

Ejemplo Simple de CSS Grid

Puede verse en vivo en CodePen

body,html{
width: 100%;
height: 100%;
margin: 0px;
}
#contenedor{
display: flex;
width: 100%;
height: 100%;
align-items: center;
justify-content: center;
background-color: grey;
}
#cuadricula{
display: grid;
grid-template-columns: 1fr 2fr 3fr;
grid-template-rows: 1fr 1fr;
width: 80%;
height: 80%;
background-color: white;
}
.celda{
background-color: cadetblue;
width: 99%;
height: 90%;
overflow-y: scroll;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="estilo.css">
</head>
<body>
<div id="contenedor">
<div id="cuadricula">
<div class="celda"></div>
<div class="celda"></div>
<div class="celda"></div>
<div class="celda"></div>
<div class="celda"></div>
<div class="celda"></div>
<div class="celda"></div>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment