diff --git a/grid.css b/grid.css index 4342c73..55565a9 100644 --- a/grid.css +++ b/grid.css @@ -55,4 +55,96 @@ code { } .nested > div:nth-child(odd) { background-color: lightgoldenrodyellow; +} + +.box-wrapper { + display: grid; + grid-template-columns: 1fr 1fr 1fr; + grid-auto-rows: 200px; + grid-gap: 2rem; + height: 100vh; + width: 100vw; + /* horizontal: start, end, center */ + justify-items: stretch; + /* vertical: start, end, center */ + align-items: stretch; +} + +.box { + background-color: lightslategray; + color: white; + font-size: 1.5rem; + border: 2px solid red; +} + + +.box1 { + grid-column: 1/4; + grid-row:1; +} + +.box2 { + grid-column: 1/2; + grid-row:2/3; +} + +.box3 { + grid-column: 2; + grid-row: 2/4; +} + +.box4 { + grid-column: 2/4; + grid-row: 3/4; +} + +.box5 { + color: lightgreen; +} + +.box6 { + color: lightgreen; +} + +.site { + display:grid; + grid-template-columns: 1fr 1fr 1fr; + grid-template-rows: 1fr 1fr 1fr 1fr; + height: 100vh; + width: 100vw; + grid-gap: 3px; + grid-template-areas: + "head head head" + "nav text text" + "nav text text" + "foot foot foot" +} + +.title { + grid-area: head; + background-color: lightblue; +} +.menu { + grid-area: nav; + background-color: lightcoral; +} +.content { + grid-area: text; + background-color: lightgoldenrodyellow; +} +.footer { + grid-area: foot; + background-color: lightgrey; + align-content: center; +} + +@media screen and (max-width: 960px) { + .site { + grid-template-rows: 1fr 1fr 2fr 1fr; + grid-template-areas: + "head head head" + "nav nav nav" + "text text text" + "foot foot foot"; + } } \ No newline at end of file diff --git a/grid2.html b/grid2.html new file mode 100644 index 0000000..7b4527a --- /dev/null +++ b/grid2.html @@ -0,0 +1,21 @@ + + + Grid + + + + +
+
1# Col(1-4), Row(1-2)
+
2# Col(1-2), Row(2-3)
+
3# Col(2-3), Row(2-4)
+
4# Col(2-4), Row(3-4)
+
5# auto
+
6# auto
+
+ + \ No newline at end of file diff --git a/grid3.html b/grid3.html new file mode 100644 index 0000000..7de3056 --- /dev/null +++ b/grid3.html @@ -0,0 +1,74 @@ + + + Grid + + + + +
+
+

HEAD

+

Welcome to CSS Grid Tutorial

+
+ +
+

CONTENT

+

+ grid-template-columns: 1fr 1fr 1fr;
+ grid-template-rows: 1fr 1fr 1fr 1fr;

+ grid-template-areas:
+

+ "head head head"
+ "nav text text"
+ "nav text text"
+ "foot foot foot"
+
+

+
+ +
+ + + \ No newline at end of file