Design comparison
SolutionDesign
Community feedback
- @krushnasinnarkarPosted 4 months ago
Hi @Talika-Bajaj,
Congratulations on successfully completing the challenge!
Your solution looks nice, though there are a couple of things you can improve which I hope will be helpful:
-
Prevent Website Stretching:
- When the screen size is increased significantly, your website gets stretched. This is because you have used
width: 100%
for the.main
element. To avoid this, you should usemax-width: 1440px
instead.
.main { max-width: 1440px; width: 100%; }
- When the screen size is increased significantly, your website gets stretched. This is because you have used
-
Add to Cart Functionality:
- When the "Add to Cart" button is clicked, the product isn't added to the cart immediately. Instead, you have to click the plus button to add the first item. You can improve this by initializing the quantity to 1 when the "Add to Cart" button is clicked. Change
<p class="add-quantity">0</p>
to<p class="add-quantity">1</p>
to ensure that one product is added to the cart when the "Add to Cart" button is clicked, and then users can increment or decrement the order using the plus or minus buttons.
<p class="add-quantity">1</p>
- When the "Add to Cart" button is clicked, the product isn't added to the cart immediately. Instead, you have to click the plus button to add the first item. You can improve this by initializing the quantity to 1 when the "Add to Cart" button is clicked. Change
I hope you find this helpful.
Feel free to reach out if you have more questions or need further assistance.
Happy coding!
0@Talika-BajajPosted 4 months agoHi @krushnasinnarkar, Thank you for the insights. I will surely update my solution.
0 -
Please log in to post a comment
Log in with GitHubJoin 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