css-grid - presentation - live-pen F

In this example below you will see how to do a css-grid - presentation - live-pen F with some HTML / CSS and Javascript

pen für livecoding in der präsentation

Thumbnail
This awesome code was written by #frontend-cop, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright #frontend-cop ©
  • HTML
  • CSS
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>css-grid - presentation - live-pen F</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  
  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <div class="grid">
  <header class="box a">Header</header>
  
  <div class="box b">Sidebar</div>
  
  <div class="box c">Content</div>
  
  <div class="box d">Footer</div>
</div>
  
  

</body>

</html>

/*Downloaded from https://www.codeseek.co/hmmh/css-grid-presentation-live-pen-f-MVOGog */
.grid {
  display: grid;
  grid-gap: 1em;
  grid-template-areas: "header" "sidebar" "content" "footer";
}
@media only screen and (min-width: 480px) {
  .grid {
    grid-auto-rows: minmax(150px, auto);
    grid-template-columns: repeat(3, 1fr);
    grid-template-areas: "header header header" "sidebar content content" "footer footer footer";
  }
}

.box {
  background: #c82506;
  color: #fff;
}
.box:nth-child(odd) {
  background: #ff0000;
}

header {
  grid-area: header;
}

.b {
  grid-area: sidebar;
}

.c {
  grid-area: content;
}

.d {
  grid-area: footer;
}

Comments