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

View file

@ -14,23 +14,20 @@
margin: 0; margin: 0;
} }
img, img {
picture,
video,
canvas,
svg {
display: block; display: block;
max-width: 100%; max-width: 100%;
} }
body { body {
background-color: #f4d04e; display: flex;
font-family: "Figtree"; justify-content: center;
} align-items: center;
.container { background-color: #f4d04e;
padding: 24px; padding: 24px;
min-height: 100dvh; min-height: 100dvh;
font-family: "Figtree";
} }
.card { .card {
@ -46,8 +43,13 @@ body {
padding: 24px; padding: 24px;
max-width: 24rem; max-width: 24rem;
}
.image-container {
display: flex;
justify-content: center;
align-items: center;
.image {
border-radius: 10px; border-radius: 10px;
overflow: hidden; overflow: hidden;
@ -61,6 +63,7 @@ body {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 12px; gap: 12px;
}
.learning { .learning {
border-radius: 4px; border-radius: 4px;
@ -79,7 +82,7 @@ body {
line-height: 1.5; line-height: 1.5;
} }
h1 { .heading {
font-weight: 800; font-weight: 800;
font-size: 24px; font-size: 24px;
line-height: 1.5; line-height: 1.5;
@ -92,7 +95,7 @@ body {
line-height: 1.5; line-height: 1.5;
} }
@media screen and (max-width: 576px) { @media (max-width: 576px) {
.learning { .learning {
font-size: 12px; font-size: 12px;
} }
@ -109,9 +112,8 @@ body {
font-size: 14px; font-size: 14px;
} }
} }
}
footer { .author {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 12px; gap: 12px;
@ -122,10 +124,3 @@ body {
line-height: 1.5; line-height: 1.5;
} }
} }
}
.center {
display: flex;
justify-content: center;
align-items: center;
}