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

html css

@n3rub1

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


I am still a newbie when it comes to CSS, I think the most difficult part was to:

  • Have a proper layout with sections and divs in HTML
  • Setting height and width on DIVs make some CSS perform some unexpected behavior.

Community feedback

Lucas 👾 104,400

@correlucas

Posted

👾Hello Robert Gatt, Congratulations on completing this challenge!

I've just opened your live site and I can say that you did a great job putting everything together! There's some tips to improve your solution.I saw that you’ve used flexbox to place the content and create the layout.

I think the best way to build this component with two columns is by using GRID LAYOUT since it is simpler to manage the columns and then create the media query for mobile. Here’s the steps to create it with grid create the main block to hold all the content (you can use <main> to wrap), set its width as max-width: 900px (it's the container size) and display: grid / grid-template-column: 1fr 1fr(this means that your component will have two columns with 50% of the container width each thats 450px). To manage the column with the text use flexbox and gap to give it the spacing between the texts or use padding-bottom to separate them.

Then to create the mobile version, all you need to do is to change the container flow vertically with grid-template-column: 1fr.

✌️ I hope this helps you and happy coding!

Marked as helpful

1

@RobertGatt

Posted

@correlucas thank you for your detailed message and your advice, much appreciated! I will keep that in mind.

1
Lucas 👾 104,400

@correlucas

Posted

@RobertGatt Then say me if was useful Robert. Keep it up =)

0
Hyron 5,870

@hyrongennike

Posted

Hi @n3rub1,

nice job on your first attempt of the challenge

You can add the following to get closer to the design.

.outerBox {
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.topDiv > div {
    flex: 1;
}
.topDiv {
    max-width: 800px;
    height: 100%;
}
0

@RobertGatt

Posted

@hyrongennike thanks for your reply. I will try that out.

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