Skip to content

Commit 59e72a0

Browse files
Update styles for layout and element presentation
Refactor CSS for layout and styling improvements.
1 parent a4712ce commit 59e72a0

1 file changed

Lines changed: 44 additions & 33 deletions

File tree

Wireframe/style.css

Lines changed: 44 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -24,66 +24,77 @@ As well as useful links to learn more */
2424
--line: 1px solid;
2525
--container: 1280px;
2626
}
27-
/* ====== Base Elements ======
28-
General rules for basic HTML elements in any context */
27+
2928
body {
3029
background: var(--paper);
3130
color: var(--ink);
3231
font: var(--font);
32+
margin: 0;
3333
}
34+
3435
a {
3536
padding: var(--space);
3637
border: var(--line);
3738
max-width: fit-content;
39+
display: inline-block;
40+
margin-top: var(--space);
41+
text-decoration: none;
3842
}
43+
3944
img,
4045
svg {
4146
width: 100%;
4247
object-fit: cover;
4348
}
44-
/* ====== Site Layout ======
45-
Setting the overall rules for page regions
46-
https://www.w3.org/WAI/tutorials/page-structure/regions/
47-
*/
49+
50+
header {
51+
text-align: center;
52+
padding: var(--space);
53+
border-bottom: var(--line);
54+
}
55+
4856
main {
4957
max-width: var(--container);
50-
margin: 0 auto calc(var(--space) * 4) auto;
58+
margin: 0 auto 100px auto;
59+
padding: var(--space);
60+
display: grid;
61+
grid-template-columns: 1fr 1fr;
62+
gap: var(--space);
5163
}
64+
65+
main > *:first-child {
66+
grid-column: span 2;
67+
}
68+
5269
footer {
5370
position: fixed;
5471
bottom: 0;
72+
width: 100%;
5573
text-align: center;
74+
background: white;
75+
border-top: var(--line);
76+
padding: var(--space);
5677
}
57-
/* ====== Articles Grid Layout ====
58-
Setting the rules for how articles are placed in the main element.
59-
Inspect this in Devtools and click the "grid" button in the Elements view
60-
Play with the options that come up.
61-
https://developer.chrome.com/docs/devtools/css/grid
62-
https://gridbyexample.com/learn/
63-
*/
64-
main {
65-
display: grid;
66-
grid-template-columns: 1fr 1fr;
67-
gap: var(--space);
68-
> *:first-child {
69-
grid-column: span 2;
70-
}
71-
}
72-
/* ====== Article Layout ======
73-
Setting the rules for how elements are placed in the article.
74-
Now laying out just the INSIDE of the repeated card/article design.
75-
Keeping things orderly and separate is the key to good, simple CSS.
76-
*/
78+
7779
article {
7880
border: var(--line);
7981
padding-bottom: var(--space);
8082
text-align: left;
8183
display: grid;
8284
grid-template-columns: var(--space) 1fr var(--space);
83-
> * {
84-
grid-column: 2/3;
85-
}
86-
> img {
87-
grid-column: span 3;
88-
}
85+
background: #f9f9f9;
86+
}
87+
88+
article > * {
89+
grid-column: 2/3;
90+
}
91+
92+
article > img {
93+
grid-column: span 3;
94+
}
95+
96+
article h2,
97+
article p,
98+
article a {
99+
margin: var(--space);
89100
}

0 commit comments

Comments
 (0)