-
Notifications
You must be signed in to change notification settings - Fork 0
Implement CSS grid in exercise files #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -5,14 +5,22 @@ | |||||
| } | ||||||
|
|
||||||
| body { | ||||||
| background: #f5f5f5; | ||||||
| color: #333; | ||||||
| display: grid; | ||||||
| font-family: 'Open Sans', sans-serif; | ||||||
| font-size: 16px; | ||||||
| grid-template-areas: | ||||||
| "header header header" | ||||||
| "nav content sidebar" | ||||||
| "nav footer footer"; | ||||||
| grid-template-columns: minmax(64px, 1fr) 3fr minmax(64px, 1fr); | ||||||
| grid-template-rows: 120px 1fr 80px; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| height: 100vh; | ||||||
| line-height: 1.5; | ||||||
| color: #333; | ||||||
| background: #f5f5f5; | ||||||
| max-width: 1440px; | ||||||
| height: 100vh; | ||||||
| padding: 20px; | ||||||
|
|
||||||
| } | ||||||
|
|
||||||
| header, | ||||||
|
|
@@ -25,3 +33,24 @@ footer { | |||||
| padding: 20px; | ||||||
| border: #08313a 1px solid; | ||||||
| } | ||||||
|
|
||||||
| header { | ||||||
| grid-area: header; | ||||||
| } | ||||||
|
|
||||||
| nav { | ||||||
| grid-area: nav; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Personally I wouldn't abbreviate this. While this might be a clear abbreviation, you'll and up using abbreviations that aren't clear to everyone. |
||||||
| } | ||||||
|
|
||||||
| main { | ||||||
| grid-area: content; | ||||||
| } | ||||||
|
|
||||||
| aside { | ||||||
| grid-area: sidebar; | ||||||
| } | ||||||
|
|
||||||
| footer { | ||||||
| grid-area: footer; | ||||||
| } | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,14 +17,19 @@ body { | |
| max-width: 1440px; | ||
| margin: 100px auto; | ||
| padding: 20px; | ||
| display: grid; | ||
| gap: 32px; | ||
| grid-template-columns: repeat(4, minmax(160px, 1fr)); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you explain the usage of |
||
| grid-template-rows: repeat(2, 1fr); | ||
| grid-auto-flow: column; | ||
| } | ||
|
|
||
| .card { | ||
| background: #fff; | ||
| border-radius: 10px; | ||
| padding: 30px; | ||
| box-shadow: rgba(17, 12, 46, 0.15) 0px 48px 100px 0px; | ||
| margin-bottom: 10px; | ||
| grid-column: auto / span 1; | ||
| } | ||
|
|
||
| .card__header { | ||
|
|
@@ -69,16 +74,24 @@ body { | |
| background-image: url('./images/bg-pattern-quotation.svg'); | ||
| background-repeat: no-repeat; | ||
| background-position: top 10px right 100px; | ||
| grid-column: 1 / span 2; | ||
| } | ||
|
|
||
| .card--bg-gray-blue { | ||
| background: hsl(217, 19%, 35%); | ||
| color: #fff; | ||
| grid-column: 3 / span 1; | ||
| } | ||
|
|
||
| .card--bg-black-blue { | ||
| background: hsl(219, 29%, 14%); | ||
| color: #fff; | ||
| grid-column: 2 / span 2; | ||
| } | ||
|
|
||
| .card:last-child { | ||
| grid-column: auto / span 1; | ||
| grid-row: 1 / -1; | ||
| } | ||
|
|
||
| footer { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,13 @@ | |
| padding: 0; | ||
| } | ||
|
|
||
| .container { | ||
| display: grid; | ||
| height: 1024px; | ||
| grid-template-columns: minmax(160px, 1fr) 4fr minmax(160px, 1fr); | ||
| grid-template-rows: 128px 128px 1fr 128px; | ||
| } | ||
|
|
||
| .box { | ||
| border-radius: 4px; | ||
| border: #000 1px solid; | ||
|
|
@@ -13,19 +20,29 @@ | |
|
|
||
| .box-1 { | ||
| background-color: #f1e0c5; | ||
| grid-column: 1 / -1; | ||
| } | ||
| .box-2 { | ||
| background-color: #c9b79c; | ||
| grid-column: 2 / -2; | ||
| } | ||
| .box-3 { | ||
| background-color: #71816d; | ||
| grid-row: 2 / -2; | ||
| grid-column: 1 / span 1; | ||
| } | ||
| .box-4 { | ||
| background-color: #342a21; | ||
| grid-row: 3 / span 1; | ||
| grid-column: 2 / -2; | ||
| } | ||
| .box-5 { | ||
| background-color: #da667b; | ||
| grid-row: 2 / -2; | ||
| grid-column: -1 / -2; | ||
|
Comment on lines
+27
to
+42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Try using |
||
| } | ||
| .box-6 { | ||
| background-color: #00272b; | ||
| grid-row: -2 / -1; | ||
| grid-column: 1 / -1; | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With what purpose did you introduce the
minmax?