diff --git a/grid/02-grid-layout-2/README.md b/grid/02-grid-layout-2/README.md new file mode 100644 index 0000000..11b7059 --- /dev/null +++ b/grid/02-grid-layout-2/README.md @@ -0,0 +1,27 @@ +# Responsive Holy Grail Layout with Grid + +This one is easy! We are going to take our Holy Grail Layout from the first exercise and make it responsive. To do this we will simply change our fixed track sizes to be dynamic. Consider this a warmup for the next exercise and make sure your layout is responding properly when resizing the browser window. + +### Hints +- You only need to add to the CSS selectors +- Use dynamic track sizes for your columns and rows + +## Desired Outcome + +When the browser is narrow: + +![desired outcome narrow](./desired-outcome-narrow.png) + +When the browser is stretched wide: + +![desired outcome wide](./desired-outcome-wide.png) + +### Self Check +- The gap is 15px +- The grid has two columns +- The grid has four rows +- The grid tracks do not use static sizes (no pixels!) +- The first column is three times larger than the other +- The third row is five times larger than the others +- The rows and columns stretch wider when making the browser window bigger +- The rows and columns stretch taller when making the browser window smaller diff --git a/grid/02-grid-layout-2/desired-outcome-narrow.png b/grid/02-grid-layout-2/desired-outcome-narrow.png new file mode 100644 index 0000000..8c66ee9 Binary files /dev/null and b/grid/02-grid-layout-2/desired-outcome-narrow.png differ diff --git a/grid/02-grid-layout-2/desired-outcome-wide.png b/grid/02-grid-layout-2/desired-outcome-wide.png new file mode 100644 index 0000000..f86d25e Binary files /dev/null and b/grid/02-grid-layout-2/desired-outcome-wide.png differ diff --git a/grid/02-grid-layout-2/index.html b/grid/02-grid-layout-2/index.html new file mode 100644 index 0000000..c072094 --- /dev/null +++ b/grid/02-grid-layout-2/index.html @@ -0,0 +1,23 @@ + + + + + + + Responsive Holy Grail + + + +
+
Header
+ + +
Article +

Lorem ipsum dolor sit amet, consectetur adipiscing 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.

+

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Curabitur bibendum turpis quis interdum semper. Sed at pharetra neque, nec lacinia diam. Suspendisse quis faucibus mi, aliquam porttitor ipsum. Vivamus condimentum eros id mattis pharetra. Duis varius eros nibh. Donec a venenatis eros. Fusce in mauris massa. Donec est metus, rhoncus eu leo sed, aliquet posuere nisl.

+

Cras ut ex in nibh accumsan ullamcorper. Fusce rutrum, metus id porta porttitor, leo ipsum congue velit, eu hendrerit lectus nisi a odio. Pellentesque tristique eros id nibh finibus euismod. Cras suscipit volutpat elit eget pulvinar. Vivamus at blandit leo. Aenean sodales ex non massa efficitur, et egestas neque dapibus. In consequat hendrerit ex, nec finibus magna faucibus eu. Aliquam a libero non erat sollicitudin condimentum. In ac fringilla nisi. Sed pharetra ut turpis id luctus. Proin posuere tortor ac tempus luctus. Donec vitae est et neque faucibus posuere. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.

+
+ +
+ + diff --git a/grid/02-grid-layout-2/solution/solution.css b/grid/02-grid-layout-2/solution/solution.css new file mode 100644 index 0000000..96f7eba --- /dev/null +++ b/grid/02-grid-layout-2/solution/solution.css @@ -0,0 +1,59 @@ +body, html { + height: 100%; + margin: 0; +} + +.container { + text-align: center; + height: 100%; + padding: 16px; + box-sizing: border-box; +} + +.container div { + padding: 15px; + font-size: 32px; + font-family: Helvetica; + font-weight: bold; + color: white; + border-radius: 15px; +} + +.header { + background-color: #FFDE22; + grid-column: 1 / 3; +} + +.sidebar { + background-color: #FF7755; + grid-row: 2 / 4; +} + +.nav { + background-color: #00DDFF; +} + +.article { + background-color: #bccbde; +} + +.article p { + font-size: 18px; + font-family: sans-serif; + color: white; + text-align: left; +} + +.footer { + background-color: #393f4d; + grid-column: 1 / 3; +} + +/* SOLUTION */ + +.container { + display: grid; + grid-template-columns: 1fr 3fr; + grid-template-rows: 1fr 1fr 5fr 1fr; + gap: 15px; +} diff --git a/grid/02-grid-layout-2/solution/solution.html b/grid/02-grid-layout-2/solution/solution.html new file mode 100644 index 0000000..52c2cbe --- /dev/null +++ b/grid/02-grid-layout-2/solution/solution.html @@ -0,0 +1,23 @@ + + + + + + + Responsive Holy Grail + + + +
+
Header
+ + +
Article +

Lorem ipsum dolor sit amet, consectetur adipiscing 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.

+

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Curabitur bibendum turpis quis interdum semper. Sed at pharetra neque, nec lacinia diam. Suspendisse quis faucibus mi, aliquam porttitor ipsum. Vivamus condimentum eros id mattis pharetra. Duis varius eros nibh. Donec a venenatis eros. Fusce in mauris massa. Donec est metus, rhoncus eu leo sed, aliquet posuere nisl.

+

Cras ut ex in nibh accumsan ullamcorper. Fusce rutrum, metus id porta porttitor, leo ipsum congue velit, eu hendrerit lectus nisi a odio. Pellentesque tristique eros id nibh finibus euismod. Cras suscipit volutpat elit eget pulvinar. Vivamus at blandit leo. Aenean sodales ex non massa efficitur, et egestas neque dapibus. In consequat hendrerit ex, nec finibus magna faucibus eu. Aliquam a libero non erat sollicitudin condimentum. In ac fringilla nisi. Sed pharetra ut turpis id luctus. Proin posuere tortor ac tempus luctus. Donec vitae est et neque faucibus posuere. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.

+
+ +
+ + diff --git a/grid/02-grid-layout-2/style.css b/grid/02-grid-layout-2/style.css new file mode 100644 index 0000000..6574067 --- /dev/null +++ b/grid/02-grid-layout-2/style.css @@ -0,0 +1,50 @@ +body, html { + height: 100%; + margin: 0; +} + +.container { + text-align: center; + height: 100%; + padding: 16px; + box-sizing: border-box; +} + +.container div { + padding: 15px; + font-size: 32px; + font-family: Helvetica; + font-weight: bold; + color: white; + border-radius: 15px; +} + +.header { + background-color: #FFDE22; + grid-column: 1 / 3; +} + +.sidebar { + background-color: #FF7755; + grid-row: 2 / 4; +} + +.nav { + background-color: #00DDFF; +} + +.article { + background-color: #bccbde; +} + +.article p { + font-size: 18px; + font-family: sans-serif; + color: white; + text-align: left; +} + +.footer { + background-color: #393f4d; + grid-column: 1 / 3; +}