Skip to content

Instantly share code, notes, and snippets.

@ahmeturganci
Created January 25, 2020 07:31
Show Gist options
  • Save ahmeturganci/066b543a39abf19d7fa7aba0550fcb8d to your computer and use it in GitHub Desktop.
Save ahmeturganci/066b543a39abf19d7fa7aba0550fcb8d to your computer and use it in GitHub Desktop.
<!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">
<title>GGWP</title>
<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<div class="container">
<h1 class='title'>flexGrid</h1>
<div class="row">
<div class="column">1/1</div>
</div>
<div class="row">
<div class="column">1/2</div>
<div class="column">1/2</div>
</div>
<div class="row">
<div class="column">1/3</div>
<div class="column">1/3</div>
<div class="column">1/3</div>
</div>
<div class="row">
<div class="column">1/4</div>
<div class="column">1/4</div>
<div class="column">1/4</div>
<div class="column">1/4</div>
</div>
<div class="row">
<div class="column col-1">1/12</div>
<div class="column">11/12</div>
</div>
<div class="row">
<div class="column col-2">2/12</div>
<div class="column">10/12</div>
</div>
<div class="row">
<div class="column col-3">3/12</div>
<div class="column">9/12</div>
</div>
<div class="row">
<div class="column col-4">4/12</div>
<div class="column">8/12</div>
</div>
<div class="row">
<div class="column col-5">5/12</div>
<div class="column">7/12</div>
</div>
<div class="row">
<div class="column col-6">6/12</div>
<div class="column">6/12</div>
</div>
</div>
</div>
</body>
</html>
body {
font-weight: 100;
font-family: Arial, Helvetica, sans-serif;
}
.container {
/* margin: 0 auto; */
background-color: #eaeaea;
max-width: 1920px;
min-width: 320px;
}
.row {
display:flex;
flex-wrap: wrap;
}
.column {
text-align: center;
flex-grow: 10;
flex-shrink: 1;
flex-basis: 1;
margin: 10px;
background-color: skyblue;
border: 1px solid black;
padding: 10px;
}
.col-1 {
max-width: calc(100% / 12);
}
.col-2 {
max-width: calc(100% / 12 * 2);
}
.col-3 {
max-width: calc(100% / 12 * 3);
}
.col-4 {
max-width: calc(100% / 12 * 4);
}
.col-5 {
max-width: calc(100% / 12 * 5);
}
.col-6 {
max-width: calc(100% / 2);
}
.title {
font-weight: 100;
padding: 10px;
text-align: center;
}
.hi {
color: #aaa;
text-align: center;
padding: 10px;
margin: 10px;
}
a, a:active, a:hover {
color: #666;
text-decoration: none;
font-weight: 500;
}
a:hover {
color: #333;
text-decoration: underline;
}
@media screen and (max-width: 768px) {
.container {
overflow: auto;
}
.column {
min-width: 100%;
width: 100%;
margin: 10px 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment