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

Block post card with reusable CSS variables

@agshinmammadov

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


Hi, It is my first challenge here. And I just tried to choose the simplest one among the challenges. Please feel free to write your feedback about the solution. I tried to create a CSS variable for easily updating the colours in the future. Divide the card into 3 blocks:

  1. image
  2. Article
  3. Author Why I made this decision. Because perhaps, in the future you will want to preview the card image and text inline not a block. So with these blocks, you will change the HTML structure with the help of CSS.

I really appreciate your support and feedback.

Community feedback

@RanitManik

Posted

give the property to the body

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

Marked as helpful

2

@agshinmammadov

Posted

Thanks for your feedback. I added it. And just forget to centre the card @RanitManik

0
Raza Abbas 790

@RazaAbbas62

Posted

Hi, your design looks good. To center the card, enclose your whole content including card-container and attribution, into a container div and apply the following to the body.

body{
display: flex;
align-items: center;
justify-content: center;
}

it will center your whole card in the body.

Enjoy Coding :)

0

@agshinmammadov

Posted

Hi, it seems like it will place the cards and text inline. Thanks for your time and support @FazeenIjaz

1
Raza Abbas 790

@RazaAbbas62

Posted

First, wrap your whole content in a separate div, and then it will work fine. @agshinmammadov

1

@agshinmammadov

Posted

Yes, you are right. And I deleted the text message and its styles @FazeenIjaz

1

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