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

Article Preview Component

Neil Kanakiaβ€’ 300

@neilk17

Desktop design screenshot for the Article preview component coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


πŸ“Things that were difficult:

  • Getting a downward triangle below the share button: Not sure what the best approach is to achieving this.
  • Getting a smooth transition to a responsive design: Was not able to create the right sizing in the mobile version of the site.

Would love to hear any feedback πŸ˜€

Community feedback

Md5 daltonβ€’ 1,430

@md5dalton

Posted

Hello Neil πŸ‘‹

To center the card perfect in the page use flex box:

body {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: 100vh;
  /* padding-top: 20rem; */
}

If you want to make your site responsive, I'd suggest you to go with mobile first approach which means all default styles are for mobile and then define media queries for bigger screen devices. I'll demonstrate:

.article-container {
   min-width: 300px;
   max-width: 730px;
}

/* Large Devices */
@madia (min-width: 768px) {
    .article-container {
       display: flex;
       align-items: center;
    }
}

This way you only have to define the flex box for larger screen devices. Also add some side padding on body to make sure the card doesn't flush against viewport edges. padding: 0 1rem; as an example. πŸ‘Œ

0
Abdalla Rahmahβ€’ 260

@AbdallaRahmah

Posted

nice work Nell, i like your work and i have some ideas for you:

  • instead of adding a large padding to the body element you can add min-height: 100vh and justify content: center this will help you center the main element.

  • also you can remove the article-container div and duplicate its styles to the main tag.

best of luck for you.

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