commit d8b4722e4026cd4e1e2af1760b87e97b1f4663cc Author: NetMan <13informatyka14@gmail.com> Date: Thu Jan 25 23:19:33 2024 +0100 Initialize diff --git a/01-grid-layout-1/README.md b/01-grid-layout-1/README.md new file mode 100644 index 0000000..e3a3ecf --- /dev/null +++ b/01-grid-layout-1/README.md @@ -0,0 +1,24 @@ +# The Holy Grail Layout with Grid + +Now it's time to practice the Grid tools we've learned and create a layout that might seem familiar. We're going to make a Holy Grail Layout like the ones we created using Flexbox. The difference here is that we won't be relying on Flexbox for this exercise. We'll only be using Grid. You'll be able to see the benefits of Grid for yourself! + +### Hints + +- You only need to add to the CSS selectors +- Look back to the Creating a Grid lesson if you forget how to turn an element into a grid +- Use fixed track sizes (e.g. pixels) for your columns and rows + +## Desired Outcome + +![desired outcome](./desired-outcome.png) + +### Self Check + +- The gap is 15px +- The grid has two columns +- The grid has four rows +- The second column is three times larger than the first +- The third row is five times larger than the others +- The header and footer elements span across both columns +- The sidebar element only spans across the first column +- The nav and article elements span across the second column diff --git a/01-grid-layout-1/desired-outcome.png b/01-grid-layout-1/desired-outcome.png new file mode 100644 index 0000000..ca46d11 Binary files /dev/null and b/01-grid-layout-1/desired-outcome.png differ diff --git a/01-grid-layout-1/index.html b/01-grid-layout-1/index.html new file mode 100644 index 0000000..5b23771 --- /dev/null +++ b/01-grid-layout-1/index.html @@ -0,0 +1,23 @@ + + + + + + + The 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/01-grid-layout-1/solution/solution.css b/01-grid-layout-1/solution/solution.css new file mode 100644 index 0000000..1ca3402 --- /dev/null +++ b/01-grid-layout-1/solution/solution.css @@ -0,0 +1,69 @@ +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: #006157 +} + +.sidebar { + background-color: #005B94 +} + +.nav { + background-color: #642cde +} + +.article { + background-color: #7E1DC3 +} + +.footer { + background-color: #393f4d; +} + +.article p { + font-size: 18px; + font-family: sans-serif; + color: white; + text-align: left; +} + +/* SOLUTION */ + +.container { + display: grid; + grid-template-columns: 300px 900px; + grid-template-rows: 100px 100px 500px 100px; + gap: 15px; +} + +.header { + grid-column: 1 / 3; +} + +.sidebar { + grid-row: 2 / 4; +} + +.footer { + grid-column: 1 / 3; +} \ No newline at end of file diff --git a/01-grid-layout-1/solution/solution.html b/01-grid-layout-1/solution/solution.html new file mode 100644 index 0000000..bbea1e5 --- /dev/null +++ b/01-grid-layout-1/solution/solution.html @@ -0,0 +1,23 @@ + + + + + + + The 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/01-grid-layout-1/style.css b/01-grid-layout-1/style.css new file mode 100644 index 0000000..6ce91a1 --- /dev/null +++ b/01-grid-layout-1/style.css @@ -0,0 +1,48 @@ +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: #006157; +} + +.sidebar { + background-color: #005B94; +} + +.nav { + background-color: #642cde; +} + +.article { + background-color: #7E1DC3; +} + +.footer { + background-color: #393f4d; +} + +.article p { + font-size: 18px; + font-family: sans-serif; + color: white; + text-align: left; +} \ No newline at end of file