Last active
February 7, 2019 02:37
-
-
Save bmoren/0ede367b2f22f2ccfba343b70f51617b to your computer and use it in GitHub Desktop.
a simple 12 column grid to de-complexify css grid for students' first go.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en" dir="ltr"> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<link rel="stylesheet" href="simplegrid.css"> | |
<link rel="stylesheet" href="testing.css"> | |
</head> | |
<body> | |
<div class="grid-parent grid-gap"> | |
<div class="start-1 end-5"> | |
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. | |
</div> | |
<div class="start-5 end-13"> | |
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. | |
</div> | |
<div class="start-1 end-3"> | |
<img src="http://placekitten.com/200/200" alt=""> | |
</div> | |
<div class="start-4 end-11"> | |
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. | |
</div> | |
<div class="start-11 end-13 test justify-self-center align-self-center"> | |
hello? | |
</div> | |
</div> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* +~+~+~+~+ Defines a 12 column grid on a container of items +~+~+~+~ */ | |
.grid-parent{ | |
display:grid; | |
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr; | |
} | |
/* +~+~+~+~+~ parent settings +~+~+~+~+~+~+~+~+ */ | |
.justify-items-start{justify-items: start;} | |
.justify-items-end{justify-items: end;} | |
.justify-items-center{justify-items: center;} | |
.justify-items-stretch{justify-items: stretch;} | |
.align-items-start{align-items: start;} | |
.align-items-end{align-items: end;} | |
.align-items-center{align-items: center;} | |
.align-items-stretch{align-items: stretch;} | |
.align-content-start{align-content: start;} | |
.align-content-end{align-content: end;} | |
.align-content-center{align-content: center;} | |
.align-content-stretch{align-content: stretch;} | |
.align-content-space-around{align-content: space-around;} | |
.align-content-space-between{align-content: space-between;} | |
.align-content-space-evenly{align-content: space-evenly;} | |
/* +~+~+~+~+~+~ child grid assignments +~+~+~+~+~+ */ | |
.start-1{grid-column-start: 1} | |
.start-2{grid-column-start: 2} | |
.start-3{grid-column-start: 3} | |
.start-4{grid-column-start: 4} | |
.start-5{grid-column-start: 5} | |
.start-6{grid-column-start: 6} | |
.start-7{grid-column-start: 7} | |
.start-8{grid-column-start: 8} | |
.start-9{grid-column-start: 9} | |
.start-10{grid-column-start: 10} | |
.start-11{grid-column-start: 11} | |
.start-12{grid-column-start: 12} | |
.start-13{grid-column-start: 13} | |
.end-1{grid-column-end: 1} | |
.end-2{grid-column-end: 2} | |
.end-3{grid-column-end: 3} | |
.end-4{grid-column-end: 4} | |
.end-5{grid-column-end: 5} | |
.end-6{grid-column-end: 6} | |
.end-7{grid-column-end: 7} | |
.end-8{grid-column-end: 8} | |
.end-9{grid-column-end: 9} | |
.end-10{grid-column-end: 10} | |
.end-11{grid-column-end: 11} | |
.end-12{grid-column-end: 12} | |
.end-13{grid-column-end: 13} | |
/* +~+~+~+~ child settings +~+~+~+~+~ */ | |
.align-self-start{align-self: start;} | |
.align-self-end{align-self: end;} | |
.align-self-center{align-self: center;} | |
.align-self-stretch{align-self: stretch;} | |
.justify-self-start{justify-self: start; } | |
.justify-self-end{justify-self: end; } | |
.justify-self-center{justify-self: center; } | |
.justify-self-stretch{justify-self: stretch; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* testing */ | |
html, body { | |
box-sizing: border-box; | |
margin:0; | |
padding:0; | |
font-size: 26px; | |
font-family: monospace; | |
color:white; | |
} | |
*, *:before, *:after { | |
box-sizing: inherit; | |
} | |
.grid-parent div{ | |
padding: 10px; | |
} | |
.grid-parent div:nth-child(odd){ | |
/* border: 1px solid black; */ | |
background-color: rgb(6, 139, 95); | |
} | |
.grid-parent div:nth-child(even){ | |
/* border: 1px solid black; */ | |
background-color: rgb(150, 50, 57); | |
} | |
.test{ | |
height:100px;width:200px; | |
} | |
/* It doesnt really make sense to set this in the core css file */ | |
.grid-gap{grid-gap: 15px} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment