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

Product-preview-card-component using HTML & CSS

@Dr-Vegapunk007

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


Hey, I just wanna know if they're a simple or easier way to do this and if i can use better semantic html than div in this situation "This is my first project here"

THANKS FOR HELPING

Community feedback

Lucas 👾 104,420

@correlucas

Posted

👾Hello @Dr-Vegapunk007, Congratulations on completing this challenge!

Your solution its almost done and I’ve some tips to help you to improve it:

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.

👨‍💻Here's my solution for this challenge if you wants to see how I build it: https://www.frontendmentor.io/solutions/product-preview-card-vanilla-css-and-custom-hover-state-on-hero-85A1JsueD1

✌️ I hope this helps you and happy coding!

Marked as helpful

1

@Dr-Vegapunk007

Posted

Thank you @correlucas , That was so helpful I will use it on the next challenges NOTE:" Your link is not working "

0
Cooger 270

@Cooger17

Posted

1.Use a CSS reset to avoid all the problems you can have with the default CSS setup, removing all margins, and making the images easier to work, see the article below where you can copy and paste this CSS code cheatsheet: https://piccalil.li/blog/a-modern-css-reset/

2.A better way to work this solution image, the product image is by using <picture> to wrap it on the html instead of using it as <img> or background-image (with the css). Using <picture> you wrap both images (desktop and mobile) and have more control over it, since you can set in the html when the images changes setting the screen size for each image.ote that for SEO / search engine reasons isn’t a better practice import this product image with CSS since this will make it harder to the image.

hope this @correlucas' comment on my solution for this challenge will help you to do it well

Marked as helpful

0

@Dr-Vegapunk007

Posted

@Cooger17 Thank you for your time

0

@Mosestule2003

Posted

Nice attempt :). Try this in your css when you start; *{ margin: 0; padding: 0; box-sizing: border-box; } This is in reference to the previous comment stating that you should use a default.

1

@Dr-Vegapunk007

Posted

@Mosestule2003 Thank you bro

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