
Design comparison
Solution retrospective
I will make my CSS more responsive next time and figure out an alternate way to handle background image.
What challenges did you encounter, and how did you overcome them?I encountered challenege in the background image and I used position: absolute to handle it.
What specific areas of your project would you like help with?CSS and Please review my JavaScript code.
Community feedback
- @MarziaJaliliPosted 3 months ago
Happy New Year Buddy!!!
Here are some tiny tips for a cleaner CSS and JS:
- JavaScript:
Use the
forEach
function instead of this long line dude:for (let i = 0; i < accordianQuestions.length; i++)
.You can take the code below as an example of how to use the
forEach
function for looping through an array:const accordianQuestions = document.getElementsByClassName("accordian"); accordianQuestions.forEach(question => { question.classList.toggle(); // rest of the code })
- CSS:
You didn't need to set a separate
<div>
for the bg-image.Simply add these lines to the body selector:
background-image: url("path of the image"); background-positoin: top; background-size: 100%; background-repeat: no-reapeat;
Hope it clarifies some of your questions😁😁.
1@drishti1920Posted 3 months ago@MarziaJalili Thankyou for your feedback. Will definitely try next time.
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