Skip to content

Commit c3e2b7d

Browse files
Use CSS to lay out and style articles so they match a wireframe design
1 parent 528a046 commit c3e2b7d

2 files changed

Lines changed: 49 additions & 7 deletions

File tree

Wireframe/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ <h1>Wireframe</h1>
1515
</header>
1616
<main class="main">
1717
<section class="content">
18-
<article>
18+
<article class="article">
1919
<img src="placeholder.svg" alt="" />
2020
<h2>Title</h2>
2121
<p>
@@ -27,7 +27,7 @@ <h2>Title</h2>
2727
</section>
2828

2929
<section class="content">
30-
<article>
30+
<article class="article">
3131
<img src="placeholder.svg" alt="" />
3232
<h2>Title</h2>
3333
<p>
@@ -37,7 +37,7 @@ <h2>Title</h2>
3737
<a href="">Read more</a>
3838
</article>
3939

40-
<article>
40+
<article class="article">
4141
<img src="placeholder.svg" alt="" />
4242
<h2>Title</h2>
4343
<p>

Wireframe/style.css

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414

1515
body {
1616
margin: 0;
17-
}
18-
19-
body,
20-
button {
2117
font-family: "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
2218
color: var(--grey-dark);
2319
font-size: 1rem;
@@ -71,3 +67,49 @@ p {
7167
flex-direction: row;
7268
gap: 1rem;
7369
}
70+
71+
72+
/* Article */
73+
74+
.article {
75+
margin-bottom: 1rem;
76+
border: medium solid var(--grey-light);
77+
border-width: medium;
78+
border-color: var(--grey-light);
79+
padding: 1rem;
80+
flex: 1;
81+
}
82+
83+
.article h2 {
84+
margin-top: 0.5rem;
85+
margin-bottom: 0.5rem;
86+
font-size: 1rem;
87+
font-weight: 700;
88+
}
89+
90+
.article p {
91+
margin-top: 0;
92+
margin-bottom: 1rem;
93+
}
94+
95+
.article a {
96+
background-color: var(--white);
97+
color: var(--black);
98+
border-style: solid;
99+
border-width: 1px;
100+
border-color: var(--black);
101+
border-radius: 4px;
102+
text-decoration: none;
103+
padding: 0.5rem 1rem;
104+
}
105+
106+
.article a:hover {
107+
background-color: var(--black);
108+
color: var(--white);
109+
border-style: solid;
110+
border-width: 1px;
111+
border-color: var(--white);
112+
border-radius: 4px;
113+
text-decoration: none;
114+
padding: 0.5rem 1rem;
115+
}

0 commit comments

Comments
 (0)