
Article Preview Component – Built with HTML, CSS & JavaScript
Design comparison
Solution retrospective
I'm most proud of successfully implementing the JavaScript toggle feature to show and hide the share popup. Since this was my first time using JavaScript in a project, I had to learn how to manipulate the DOM and toggle CSS classes dynamically. Additionally, I refined my CSS positioning skills, using absolute positioning and Chrome DevTools to ensure pixel-perfect alignment.
Next time, I want to focus on improving my JavaScript skills.
What challenges did you encounter, and how did you overcome them?One of the biggest challenges I faced was learning JavaScript, especially how to manipulate the DOM and toggle elements dynamically. Since this was my first time using JavaScript in a project, it took me a while to fully understand how event listeners and class toggling work.
To overcome this, I watched multiple YouTube tutorials and read several online articles and documentation to deepen my understanding. Experimenting with different approaches in Google Chrome DevTools also helped me troubleshoot issues and refine my implementation. Through persistence and hands-on practice, I was able to get the share button functionality working as expected.
What specific areas of your project would you like help with?CSS Positioning Best Practices: I used absolute positioning to place the share popup, but I had to rely heavily on trial and error with Chrome DevTools. Are there more effective techniques for positioning elements dynamically while keeping the layout flexible?
Community feedback
- P@huyphan2210Posted 26 days ago
Hi @jayco01,
I've checked out your solution and wanted to share my thoughts:
- Trial and error is part of a developer's daily routine. Using browser DevTools is an essential skill for frontend developers, so don't worry about it—it's completely normal.
- Using
position
for.social__popup
is a solid approach in this case. However, I’d recommend using vw, vh, or % instead ofem
inbottom: 5.5em
. Theem
unit is relative to the parent’sfont-size
(which is<main>
here), and there doesn’t seem to be a strong connection between the parent font size and the position of.social__popup
. - Your question about "positioning elements dynamically while keeping the layout flexible" is quite broad. Could you clarify what specific issue you're facing? Providing more context would help avoid a vague or confusing answer.
Looking forward to your response!
Marked as helpful1
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