Design comparison
Solution retrospective
This is my second challenge today, there was some problem in making it with mobile view, so if anyone thinks my code is wrong then please let me know.
Community feedback
- @correlucasPosted about 2 years ago
👾Hello @nemesisaquib, Congratulations on completing this challenge!
Your solution its almost done and I’ve some tips to help you to improve it:
Its amazing that you’ve customized some interaction, you’ve to pay attention because when you add some
hover effects
you've to think that for the mobile version there's an issue that the elements with hover getstuck
on the active state of the hover until you click on something else. Something you can do to avoid this problem on mobile, the stick hover, is to add a media query saying that you want hover effects only on devices that are nottouch
. So you can use:@media (hover: hover) { {ADD HERE ALL THE CLASSES WITH HOVER EFFECTS TO DISABLE IT ON MOBILE} }
Using
<picture>
you’ve more control over the elements and its better than using the product image as<img>
orbackground-image
. Look that for SEO and search engine reasons it isn't a better practice to import this product image with CSS since this will make it harder to the image. You can manage both images inside the<picture>
tag and use the html to code to set when the images should change setting the devicemax-width
depending of the device (phone / computer) Here’s a guide about how to usepicture
:https://www.w3schools.com/tags/tag_picture.asp
✌️ I hope this helps you and happy coding!
Marked as helpful1@nemesisaquibPosted about 2 years ago@correlucas oh okay sir thank you very much sir i didn't know about this sir told me about the some new element i will work on it ...thank you sir
0@nemesisaquibPosted about 2 years ago@correlucas I have a question if we want to apply on hover effect that it gets disabled in mobile view how can we do that?
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