Product preview card component using HTML ans CSS(Flex)
Design comparison
Solution retrospective
Another challenge done...Though I totally loved it...but I have faced few issues too....Like I don't know how to use two image url in img tag....if I'm using background property in image then I can change the image url in mobile view using media query...but how to change the url while using img tag???? Please let me know how to do it....It will be helpful if u can give me some suggestions to improve img tag... Please do tell me if i have made any mistake....and I'd be grateful if you can give me some feedbacks to improve π
Community feedback
- @AdrianoEscarabotePosted about 2 years ago
Hi Taskin Sultana, how are you?
I really liked the result of your project, but I have some tips that I think you will like:
About using two images in the img tag, this is not possible, either you can use background-image or use the picture tag I will leave a link for you to read more about:
the rest is great, I really liked the background color you used!
Hope it helps...π
0 - @correlucasPosted about 2 years ago
πΎHello Taskin Sultana, Congratulations on completing this challenge!
Amazing solution and great design! I liked a lots the colors. Here's some tips for you:
1.Align vertically the text content with
display: flex
:.text { display: flex; background-color: hsl(0, 0%, 100%); padding: 10px 35px; border-top-right-radius: 10px; border-bottom-right-radius: 10px; flex-direction: column; align-items: flex-start; justify-content: center; }
2.THE PICTURE TAG is a shortcut to deal with the multiple images in this challenge. So you can use the
<picture>
tag instead of importing this as an<img>
or using a div withbackground-image
. Use it to place the images and make the change between mobile and desktop, instead of using adiv
orimg
and set the change in the css withdisplay: none
with the tag picture is more practical and easy. Note 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. 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 desktop + mobile.Check the link for the official documentation for
<picture>
in W3 SCHOOLS:https://www.w3schools.com/tags/tag_picture.asp
βοΈ I hope this helps you and happy coding!
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