Jordakoes
7/20/2018 - 2:36 PM

CSS Grid Template 1 Item

CSS Grid Template 1 Item

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <!-- Font -->
    <link href="https://fonts.googleapis.com/css?family=Ubuntu" rel="stylesheet"> 
    <link rel="stylesheet" href="main.css">
    <title>Document</title>
</head>


<body>
  <div class="container">
    <h1>My Content</h1>
    <p>My paragraph content right here.</p>
  </div>  
</body>

</html>
* {
    font-family: 'Ubuntu', sans-serif;
}

body, html {
    margin: 0;
    height: 100%;
}

body {
    /* Make the body element the grid container */
    display: grid;
    /* Set the amount of rows */
    grid-template-rows: auto;
    /* Set the amount of columns */
    grid-template-columns: auto;
    /* Align everything on ROW axis */
    justify-items: center;
    /* Align everything on COLUMN axis */
    align-items: center;
}

.container {
    grid-column-start: 1;

    background: rgb(230, 230, 230);
    border-radius: 10px;
    padding: 1em;
}