Design comparison
Solution retrospective
Any recommendation for improvement?
Community feedback
- @artimysPosted about 4 years ago
Hey there Joaquin, good job on completing the challenge.
Some tips: One of the first things that caught my eye was the extra page height when going to mobile. Try
min-height: 100vh
on your body. Anything greater than 100 will create a longer page than your viewport can fit and will result in that scrollbar popping up.Add a bit of line spacing in your
<p>
tags usingline-height
property. Browsers by default style<p>
tags with almost no breathable line spacing. Opposite for heading tags.- In the JS, I noticed a pattern with duplicate event listeners for
arrow
andanswer
variables. Any time you have a collection try using a loop to access each element. - Also use the plural form for variable names when using
document.getElementsByClassName
for (var n=0; n < arrows.length; n++) { arrows[n].addEventListener('click', function(){ clickArrow(n) }); }
Hope it helps and keep on coding
1@jbuendia1yPosted about 4 years agoThanks for the tips, especially the one from JS and I will try to use plurals in the variables
1 - In the JS, I noticed a pattern with duplicate event listeners for
- @grace-snowPosted about 4 years ago
It works, but seems to need multiple clicks sometimes. I think your js could be much simpler, just looping over all faqs, listening for a click on all and toggling a class on click.
If you made the divs into buttons, you'd also get all the interactive accessible behaviour for free. That would be some more work to change though as would affect your css as well.
Things to think about, anyway. Happy coding
0@jbuendia1yPosted about 4 years agoThanks for the comment of the clicks, I will try to improve the js.
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