Skip to content

Commit 78d4559

Browse files
committed
Align layout with wireframe: centered header and 2-column articles
1 parent ea9304a commit 78d4559

2 files changed

Lines changed: 23 additions & 12 deletions

File tree

Wireframe/index.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
</head>
99

1010
<body>
11-
<header>
11+
<header class="page-header">
1212
<h1>Wireframe to Web Code</h1>
1313
<p>
1414
A simple webpage built from a wireframe using semantic HTML and CSS.
1515
</p>
1616
</header>
1717

1818
<main>
19-
<section aria-label="Articles">
20-
<article>
21-
<img src="placeholder.svg" alt="" />
19+
<section class="articles" aria-label="Articles">
20+
<article class="article article-featured">
21+
<img src="placeholder.svg" alt="" aria-hidden="true" />
2222
<h2>What is the purpose of a README file?</h2>
2323
<p>
2424
A README is the first place someone looks when they open a project.
@@ -35,8 +35,8 @@ <h2>What is the purpose of a README file?</h2>
3535
</a>
3636
</article>
3737

38-
<article>
39-
<img src="placeholder.svg" alt="" />
38+
<article class="article">
39+
<img src="placeholder.svg" alt="" aria-hidden="true" />
4040
<h2>What is the purpose of a wireframe?</h2>
4141
<p>
4242
A wireframe is a simple layout sketch that shows where key parts of
@@ -53,8 +53,8 @@ <h2>What is the purpose of a wireframe?</h2>
5353
</a>
5454
</article>
5555

56-
<article>
57-
<img src="placeholder.svg" alt="" />
56+
<article class="article">
57+
<img src="placeholder.svg" alt="" aria-hidden="true" />
5858
<h2>What is a branch in Git?</h2>
5959
<p>
6060
A branch is an independent line of work in a Git repository. It lets

Wireframe/style.css

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ main {
7676
padding: calc(var(--space) * 2);
7777
}
7878

79+
/* Center the PAGE TITLE and the SUBTITLE (matches wireframe + reviewer feedback) */
80+
.page-header {
81+
text-align: center;
82+
}
83+
7984
main {
8085
/* Prevent overlap with fixed footer and give the layout breathing room */
8186
padding-bottom: calc(var(--footer-height) + (var(--space) * 2));
@@ -106,14 +111,14 @@ Play with the options that come up.
106111
https://developer.chrome.com/docs/devtools/css/grid
107112
https://gridbyexample.com/learn/
108113
*/
109-
main {
114+
.articles {
110115
display: grid;
111116
grid-template-columns: 1fr 1fr;
112117
gap: calc(var(--space) * 2);
113118
}
114119

115120
/* Make the first article span both columns (wireframe layout) */
116-
main > *:first-child {
121+
.articles > *:first-child {
117122
grid-column: 1 / -1;
118123
}
119124

@@ -122,6 +127,7 @@ Setting the rules for how elements are placed in the article.
122127
Now laying out just the INSIDE of the repeated card/article design.
123128
Keeping things orderly and separate is the key to good, simple CSS.
124129
*/
130+
.article,
125131
article {
126132
border: var(--line);
127133
padding-bottom: var(--space);
@@ -130,29 +136,34 @@ article {
130136
grid-template-columns: var(--space) 1fr var(--space);
131137
}
132138

139+
.article > *,
133140
article > * {
134141
grid-column: 2/3;
135142
}
136143

144+
.article > img,
137145
article > img {
138146
grid-column: 1 / -1;
139147
}
140148

141149
/* Optional: improve spacing/readability while keeping the wireframe feel */
150+
.article h2,
142151
article h2 {
143152
margin: calc(var(--space) * 1.5) 0 var(--space);
144153
}
145154

155+
.article p,
146156
article p {
147157
margin: 0 0 calc(var(--space) * 1.5);
148158
}
149159

160+
/* Keep layout readable on small screens */
150161
@media (max-width: 700px) {
151-
main {
162+
.articles {
152163
grid-template-columns: 1fr;
153164
}
154165

155-
main > *:first-child {
166+
.articles > *:first-child {
156167
grid-column: auto;
157168
}
158169
}

0 commit comments

Comments
 (0)