Design comparison
Solution retrospective
I take pride in implementing the clamp() function to achieve responsive typography. Looking forward, I would enhance my approach by exploring additional techniques for even more versatile and dynamic designs.
What challenges did you encounter, and how did you overcome them?I faced challenges adapting images for mobile and desktop, but I overcame them by utilizing CSS's content feature within img tags, ensuring a responsive solution.
What specific areas of your project would you like help with?animation and parallax effect
Community feedback
- @IkuewumiPosted 9 months ago
Hi @ParthUON. Awesome Project š
About your question, I was impressed by the use of the
content
property, I always thought it was only used in pseudo-elements. But the answer here would be to use the picture element,This is an example
<picture> <source srcset="...desktop.jpg" media="(min-width: 40rem)"> <img src="...mobile.jpg" alt=""> </picture>
picture { display: contents; } picture img { width: xrem; // more }
What happens is that the browser switches out the src of the image when it hits a specified media query
A caveat though is that the content that is shown is only the image tag, so I would suggest, putting any styles on the image tag
You can learn more about the picture tag on the MDN docs
And btw what do you need parallax for?
Happy Coding, Ayobami
Marked as helpful1@ParthUONPosted 9 months ago@Ikuewumi thank you for your advice. i will keep in mind next time. i want to create my portfolio website using parallax effect.
0 - @danielmrz-devPosted 9 months ago
Hello @ParthUON!
Your project looks great!
I have a suggestion about your code that might interest you:
š You can use the
<picture>
tag when you have different versions of the same image.Using the
<picture>
tag will help load the correct image to the user's device, saving bandwidth and improving performance.Example:
<picture> <source media="(max-width: 460px)" srcset="{desktop image path here}"> <img src="{mobile image path here}" alt="{alternative text here}"> </picture>
I hope this helps!
Other than that, excellent work!
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