Skip to content

Commit 3e06109

Browse files
refactor: update HTML structure and enhance CSS styles for article cards
1 parent 345a891 commit 3e06109

2 files changed

Lines changed: 105 additions & 16 deletions

File tree

‎Wireframe/index.html‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
<link rel="stylesheet" href="style.css" />
88
</head>
99
<body>
10+
1011
<header class="page-header">
12+
1113
<h1>Wireframe</h1>
1214
<p>
1315
This is the default, provided code and no changes have been made yet.
@@ -18,43 +20,43 @@ <h1>Wireframe</h1>
1820

1921
<article class="article-card featured">
2022
<img src="placeholder.svg" alt="Placeholder Image" />
21-
<div>
23+
<div class="article-content">
2224
<h2>Title</h2>
2325
<p>
2426
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam,
2527
voluptates. Quisquam, voluptates.
2628
</p>
27-
<a href="">Read more</a>
29+
<a href="" class="read-more">Read more</a>
2830
</div>
2931

3032
</article>
3133

3234
<article class="article-card">
3335
<img src="placeholder.svg" alt="Placeholder Image" />
34-
<div>
36+
<div class="article-content">
3537
<h2>Title</h2>
3638
<p>
3739
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam,
3840
voluptates. Quisquam, voluptates.
3941
</p>
40-
<a href="">Read more</a>
42+
<a href="" class="read-more">Read more</a>
4143
</div>
4244
</article>
4345

44-
<article>
46+
<article class="article-card">
4547
<img src="placeholder.svg" alt="Placeholder Image" />
46-
<div>
48+
<div class="article-content">
4749
<h2>Title</h2>
4850
<p>
4951
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam,
5052
voluptates. Quisquam, voluptates.
5153
</p>
52-
<a href="">Read more</a>
54+
<a href="" class="read-more">Read more</a>
5355
</div>
5456
</article>
5557

5658
</main>
57-
59+
5860
<footer>
5961
<p>
6062
This is the default, provided code and no changes have been made yet.

‎Wireframe/style.css‎

Lines changed: 95 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,95 @@
1-
/*
2-
(Suggestion) Use a top-down approach when applying CSS:
3-
1. Lay out the top-level elements: <header>, <main>, <footer>
4-
2. Lay out the articles within <main>
5-
3. Style individual elements
6-
7-
Please REMOVE this comment before submitting your work.
8-
*/
1+
* {
2+
box-sizing: border-box;
3+
margin: 0;
4+
padding: 0;
5+
}
6+
7+
body {
8+
font-family: Arial, Helvetica, sans-serif;
9+
line-height: 1.5;
10+
padding: 20px;
11+
max-width: 1000px;
12+
margin: auto;
13+
color: #3330;
14+
}
15+
16+
.page-header {
17+
text-align: center;
18+
margin-bottom: 30px;
19+
}
20+
21+
.page-header h1 {
22+
font-size: 2rem;
23+
color: #333;
24+
font-weight: 600;
25+
letter-spacing: 1px;
26+
}
27+
28+
.page-header p {
29+
color: #666;
30+
font-size: 0.95rem;
31+
}
32+
33+
.content-grid {
34+
display: grid;
35+
grid-template-columns: 1fr 1fr;
36+
gap: 20px;
37+
margin-bottom: 40px;
38+
}
39+
40+
.article-card {
41+
border: 1px solid #ccc;
42+
padding: 15px;
43+
background: #fff;
44+
display: flex;
45+
flex-direction: column;
46+
justify-content: space-between;
47+
}
48+
49+
.article-card.featured {
50+
grid-column: 1 / -1;
51+
}
52+
53+
.article-card img {
54+
width: 100%;
55+
height: auto;
56+
aspect-ratio: 16 / 9;
57+
background-color: #e0e0e0;
58+
object-fit: cover;
59+
margin-bottom: 12px;
60+
border: 1px dashed #999;
61+
}
62+
63+
.article-content h2{
64+
font-size: 1.1rem;
65+
margin-bottom: 6px;
66+
}
67+
68+
.article-content p {
69+
font-size: 0.9rem;
70+
color: #555;
71+
margin-bottom: 12px;
72+
}
73+
74+
.read-more {
75+
display: inline-block;
76+
padding: 6px 12px;
77+
border: 1px solid #333;
78+
text-decoration: none;
79+
color: #333;
80+
font-size: 0.85rem;
81+
align-self: flex-start;
82+
}
83+
84+
.read-more:hover {
85+
background-color: #333;
86+
color: #fff;
87+
}
88+
89+
footer {
90+
text-align: center;
91+
border-top: 1px solid #ddd;
92+
padding-top: 20px;
93+
font-size: 0.85rem;
94+
color: #666;
95+
}

0 commit comments

Comments
 (0)