1
Fork 0

Remove nesting

This commit is contained in:
Hadeed 2024-07-03 19:56:44 +05:00
parent 5d5cc6a6a4
commit d9df9406ef
2 changed files with 111 additions and 113 deletions

View file

@ -15,9 +15,8 @@
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<div class="container center">
<div class="card">
<div class="image center">
<main class="card">
<div class="image-container">
<img
src="/images/illustration-article.svg"
alt="Article illustration"
@ -29,19 +28,23 @@
<p class="date">Published 21 Dec 2023</p>
<h1>HTML & CSS foundations</h1>
<h1 class="heading">HTML & CSS foundations</h1>
<p class="description">
These languages are the backbone of every website, defining
structure, content, and presentation.
These languages are the backbone of every website, defining structure,
content, and presentation.
</p>
</div>
<footer>
<img width="32px" height="32px" src="/images/image-avatar.webp" alt="Author avatar">
<div class="author">
<img
width="32px"
height="32px"
src="/images/image-avatar.webp"
alt="Greg Hooper"
/>
<p>Greg Hooper</p>
</footer>
</div>
</div>
</main>
</body>
</html>

View file

@ -14,23 +14,20 @@
margin: 0;
}
img,
picture,
video,
canvas,
svg {
img {
display: block;
max-width: 100%;
}
body {
background-color: #f4d04e;
font-family: "Figtree";
}
display: flex;
justify-content: center;
align-items: center;
.container {
background-color: #f4d04e;
padding: 24px;
min-height: 100dvh;
font-family: "Figtree";
}
.card {
@ -46,8 +43,13 @@ body {
padding: 24px;
max-width: 24rem;
}
.image-container {
display: flex;
justify-content: center;
align-items: center;
.image {
border-radius: 10px;
overflow: hidden;
@ -55,14 +57,15 @@ body {
height: 200px;
object-fit: cover;
}
}
}
.content {
.content {
display: flex;
flex-direction: column;
gap: 12px;
}
.learning {
.learning {
border-radius: 4px;
background-color: #f4d04e;
padding: 4px 12px;
@ -71,28 +74,28 @@ body {
font-weight: 800;
font-size: 14px;
line-height: 1.5;
}
}
.date {
.date {
font-weight: 500;
font-size: 14px;
line-height: 1.5;
}
}
h1 {
.heading {
font-weight: 800;
font-size: 24px;
line-height: 1.5;
}
}
.description {
.description {
color: #7f7f7f;
font-weight: 500;
font-size: 16px;
line-height: 1.5;
}
}
@media screen and (max-width: 576px) {
@media (max-width: 576px) {
.learning {
font-size: 12px;
}
@ -108,10 +111,9 @@ body {
.description {
font-size: 14px;
}
}
}
}
footer {
.author {
display: flex;
align-items: center;
gap: 12px;
@ -121,11 +123,4 @@ body {
font-size: 14px;
line-height: 1.5;
}
}
}
.center {
display: flex;
justify-content: center;
align-items: center;
}