Skip to content

Commit 370d54b

Browse files
committed
Refactor CSS styles for improved layout and readability
1 parent 956678e commit 370d54b

1 file changed

Lines changed: 27 additions & 10 deletions

File tree

Wireframe/style.css

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,18 @@ As well as useful links to learn more */
2222
--font: 100%/1.5 system-ui;
2323
--space: clamp(6px, 6px + 2vw, 15px);
2424
--line: 1px solid;
25-
--container: 1280px;
25+
--container: 900px;
2626
}
2727
/* ====== Base Elements ======
2828
General rules for basic HTML elements in any context */
2929
body {
3030
background: var(--paper);
3131
color: var(--ink);
3232
font: var(--font);
33+
margin: 0 auto;
34+
text-align: center;
3335
}
36+
3437
a {
3538
padding: var(--space);
3639
border: var(--line);
@@ -48,12 +51,19 @@ https://www.w3.org/WAI/tutorials/page-structure/regions/
4851
main {
4952
max-width: var(--container);
5053
margin: 0 auto calc(var(--space) * 4) auto;
54+
width: 70%;
55+
text-align: center;
5156
}
57+
5258
footer {
53-
position: fixed;
54-
bottom: 0;
5559
text-align: center;
60+
margin: 0 auto;
61+
padding: 2rem 0;
62+
background-color: white;
63+
width: 100%;
64+
border-top: var(--line);
5665
}
66+
5767
/* ====== Articles Grid Layout ====
5868
Setting the rules for how articles are placed in the main element.
5969
Inspect this in Devtools and click the "grid" button in the Elements view
@@ -69,21 +79,28 @@ main {
6979
grid-column: span 2;
7080
}
7181
}
82+
header {
83+
text-align: center;
84+
}
85+
86+
article {
87+
border: var(--line);
88+
padding: var(--space);
89+
text-align: left;
90+
}
91+
7292
/* ====== Article Layout ======
7393
Setting the rules for how elements are placed in the article.
7494
Now laying out just the INSIDE of the repeated card/article design.
7595
Keeping things orderly and separate is the key to good, simple CSS.
7696
*/
77-
article {
97+
section {
7898
border: var(--line);
7999
padding-bottom: var(--space);
100+
80101
text-align: left;
81-
display: grid;
82-
grid-template-columns: var(--space) 1fr var(--space);
83-
> * {
84-
grid-column: 2/3;
85102
}
86-
> img {
103+
img {
104+
width: 100%;
87105
grid-column: span 3;
88106
}
89-
}

0 commit comments

Comments
 (0)