Update exercise 3 CSS

This commit is contained in:
Daniel Murphy 2022-01-12 17:18:49 -05:00
parent 373dc4e9bc
commit aebe42c8c7
9 changed files with 0 additions and 210 deletions

View File

@ -1,27 +0,0 @@
# 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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 384 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 390 KiB

View File

@ -1,23 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Responsive Holy Grail</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<div class="header">Header</div>
<div class="sidebar">Sidebar</div>
<div class="nav">Nav</div>
<div class="article">Article
<p>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.</p>
<p>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.</p>
<p>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.</p>
</div>
<div class="footer">Footer</div>
</div>
</body>
</html>

View File

@ -1,58 +0,0 @@
.container {
text-align: center;
}
.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;
grid-row: 1 / 2;
}
.sidebar {
background-color: #FF7755;
grid-column: 1 / 2;
grid-row: 2 / 4;
}
.nav {
background-color: #00DDFF;
grid-column: 2 / 3;
grid-row: 2 / 3;
}
.article {
background-color: #bccbde;
grid-column: 2 / 3;
grid-row: 3 / 4;
}
.article p {
font-size: 18px;
font-family: sans-serif;
color: white;
text-align: left;
}
.footer {
background-color: #393f4d;
grid-column: 1 / 3;
grid-row: 4 / 5;
}
/* SOLUTION */
.container {
display: grid;
grid-template-columns: 1fr 3fr;
grid-template-rows: 1fr 1fr 5fr 1fr;
gap: 15px;
}

View File

@ -1,23 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Responsive Holy Grail</title>
<link rel="stylesheet" href="solution.css">
</head>
<body>
<div class="container">
<div class="header">Header</div>
<div class="sidebar">Sidebar</div>
<div class="nav">Nav</div>
<div class="article">Article
<p>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.</p>
<p>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.</p>
<p>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.</p>
</div>
<div class="footer">Footer</div>
</div>
</body>
</html>

View File

@ -1,49 +0,0 @@
.container {
text-align: center;
}
.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;
grid-row: 1 / 2;
}
.sidebar {
background-color: #FF7755;
grid-column: 1 / 2;
grid-row: 2 / 4;
}
.nav {
background-color: #00DDFF;
grid-column: 2 / 3;
grid-row: 2 / 3;
}
.article {
background-color: #bccbde;
grid-column: 2 / 3;
grid-row: 3 / 4;
}
.article p {
font-size: 18px;
font-family: sans-serif;
color: white;
text-align: left;
}
.footer {
background-color: #393f4d;
grid-column: 1 / 3;
grid-row: 4 / 5;
}

View File

@ -5,7 +5,6 @@
.container {
text-align: center;
}
.container div {
@ -18,30 +17,24 @@
.header {
background-color: #393f4d;
}
.logo {
}
.menu {
}
.menu ul {
}
.menu ul,
.menu li {
font-size: 16px;
}
.sidebar {
background-color: #FF7755;
}
.sidebar .photo {
@ -53,7 +46,6 @@
}
.photo {
}
.sidebar .side-content {
@ -61,16 +53,13 @@
color: black;
font-size: 16px;
font-weight: normal;
}
.nav {
background-color: #FF7755;
}
.nav ul {
}
.nav ul li {
@ -80,7 +69,6 @@
.article {
background-color: #bccbde;
}
.article p {
@ -94,14 +82,12 @@
background-color: #FFFFFF;
color: black;
text-align: center;
}
.card p {
color: black;
font-weight: normal;
font-size: 14px;
}
.card .title {
@ -111,7 +97,6 @@
.footer {
background-color: #393f4d;
}
.footer p {

View File

@ -5,7 +5,6 @@
.container {
text-align: center;
}
.container div {
@ -18,30 +17,24 @@
.header {
background-color: #393f4d;
}
.logo {
}
.menu {
}
.menu ul {
}
.menu ul,
.menu li {
font-size: 16px;
}
.sidebar {
background-color: #FF7755;
}
.sidebar .photo {
@ -53,7 +46,6 @@
}
.photo {
}
.sidebar .side-content {
@ -61,16 +53,13 @@
color: black;
font-size: 16px;
font-weight: normal;
}
.nav {
background-color: #FF7755;
}
.nav ul {
}
.nav ul li {
@ -80,7 +69,6 @@
.article {
background-color: #bccbde;
}
.article p {
@ -94,14 +82,12 @@
background-color: #FFFFFF;
color: black;
text-align: center;
}
.card p {
color: black;
font-weight: normal;
font-size: 14px;
}
.card .title {
@ -111,7 +97,6 @@
.footer {
background-color: #393f4d;
}
.footer p {