Design comparison
SolutionDesign
Solution retrospective
Here is a problem ,When shrinking the label, box - image is hard too adjust. need some suggestions.
Community feedback
- @mjbagaPosted over 2 years ago
Hi, Niezzx! Good job on the challenge.
I've checked your code out and here's some feedback:
- The container is expanding because of the hidden paragraph content being shown. Notice that it doesn't expand when the paragraph isn't as long as 2 lines. Try transferring that hidden paragraph inside the question-bar div so that it will follow the width of its parent container and you won't have to us percent width on the paragraph.
- I checked your JS. For adding event listeners to querySelectorAll, you don't need to loop through each item. I get that you're trying to access the ID, but you can just do it by simply traversing the DOM.
- Check out this article https://medium.com/codex/how-to-traverse-the-dom-in-javascript-7fece4a7751c for traversing DOM. Basically if you have queried an element, like with querySelectorAll, you can use that as a basepoint to either go up the DOM to access parents, or go down the DOM to access children.
Hope this helps! Happy coding!
Marked as helpful0
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