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

perfume ad page, made using html and css, with lots and lots of flexb

@AlexaGabriel

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


perfume ad page, made using html and css, with a lot, a lot of flexbox lol and responsive, I wanted to test some knowledge as I've already done this project before, as it was supposed to be quick I didn't want to use variables for colors and fonts, which in a way took my time

Community feedback

Daniel 🛸 44,230

@danielmrz-dev

Posted

Hello @AlexaGabriel!

Your solution looks great!

I have just a couple of suggestions for improvement:

  • Avoid using percentage or viewport height/width based values to set an element's width and height. This can cause bugs and make your element grow too much on some screen sizes or not grow enough on others.

To fix that, use max-width with fixed values, like pixels to set a limit. By doing that, your project remains responsive, but it won't grow too much, because you set a limit for it.

For height, just add the content and let the container adapt. Most times it'll be just the size it needs to be and you can adjust what you need with margins and paddings in the elements inside of it.

I hope it helps!

Other than that, you did an excelent job!

Marked as helpful

0

@AlexaGabriel

Posted

@danielmrz-dev It was something I had a little doubt about, thanks for the feedback, it helped me a lot

1

@Blackpachamame

Posted

Here are some details that may be useful to you.

  • Apply a reset for the universal selector:
* {
    box-sizing: border-box;
    margin: 0;
}
  • Remove unnecessary properties from the body, also apply the gap property to separate the main from the footer (which by the way, that <div class="attribution"> should be a footer) :
body {
    background-color: hsl(30, 38%, 92%);
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* align-content: center;  This is not going*/
    justify-content: center;
    align-items: center;
    gap: 20px;
}

@media screen and (max-width: 767px){
  body {
    margin: 20px;
  }
}
  • It is simpler if you use grid instead of flex to separate each part of the card in half. Additionally, you can use an overflow: hidden so you don't need to apply borders to the image. I leave you my version in case you want to review it: My challenge

Marked as helpful

0

@AlexaGabriel

Posted

@Blackpachamame wow, I saw your job, it's a good job congratulations, and thanks of the feedback

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