Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

blog-preview-card-main

@ahmed101na

Desktop design screenshot for the Blog preview card coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


blog-preview-card-main

Community feedback

Nadun Dhananjayaโ€ข 210

@nadun-dhananjaya

Posted

Hello ๐Ÿ‘‹. Congratulations on successfully completing the challenge! ๐ŸŽ‰

I have other recommendations regarding your code that I believe will greatly interest you

HTML and CSS

  • In this challenge Blog card is the main content of the page. Therefore, adding a <main> tag around the container is a good practice.
<html lang="en">
  <head>
    <-- Your head content here -->
  </head>
  <body>
    <-- main -->
    <main>
      <-- container -->
      <div class="container">
         <-- Card content here -->
     </div>
  </main>
 </body>
</html>
  • The Blog card is not in the middle of the screen. You can centralize your blog card by centralizing the items inside the main tag.

You can centering the card on the screen using display: gird:

main {
    display: grid;
    place-items: center;
    min-height: 100vh;
}

or

using display: flex as below

main {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}
0

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord