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

Responsive - Product preview

@Haswolinsk

Desktop design screenshot for the Product preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Someone any idea of how for simplify my code? I have no idea how I could further simplify this code, but I welcome suggestions :]

Community feedback

@Rupsnigdha

Posted

Okay so here are some suggestions :

  • for <p style="margin-top: 0;">P E R F U M E</p>, t=you could've also used letter-spacing: x px; to get more control.
  • From the next time, I would not use inline styling unless absolutely necessary. So for example, even though you have a h1 {...} in your <styles> tag, you still have added inline styles to the <h1> in the HTML. I would definitely recommend maintaining a different file for CSS and maybe even go and look into CSS selectors in depth. It really helps selecting and fine-tuning specific elements.
  • Instead of using margins on each element of .card, try using display: flex; align-items: space-between
  • Try storing the color palette and fonts as variables in the :root element. So for example something like :
:root {
     --color-primary: #0FF;
     --color-secondary: #000;
     --color-white: #FFF;
     --font: "Montserrat", sans-serif;
}

Other than this, you did a really good job making this. Congratulations it looks amazing!

Marked as helpful

1

@Haswolinsk

Posted

@Rupsnigdha

  • About the align-items: space-between in .card i have no idea for why, but my page wouldn't accept, it so i had to leave it in the current format.
  • And thanks for the tips :]
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