Design comparison
Solution retrospective
I am not good at using Javascript. My issues are not enough the whitespace at the bottom when multiple answers are selected in both desktop and mobile view. The other one could be the design how the card is not center at the begin of any screen size. This looks okay on 375px and 1440px width screen. Any other will not center the card. Let me know what else I can learn. Thanks!
Community feedback
- @Jos02378Posted about 3 years ago
Hey @nottohave, good job on this solution!
Some suggestions for you:
- For the space problem of the card, you can fix it by not setting a fixed height on the card. You can use a
min-height
or not setting the height at all so your card can grow as your content grows. - For centering the card, you can try to use
margin: 0 auto
. - You can improve your method of creating the accordion by watching this video watch the video
- You can try to follow a CSS naming convention called BEM. You can watch this video for more information Watch the video.
- You can try to use relative units like em in the future. Here is a link to an article that explains when to use which unit see the article.
I hope this helps, good luck!
Marked as helpful0@nottohavePosted about 3 years ago@Jos02378 Thanks for the insights. I never find design this difficult. I think I will watch the videos and rethink my design. It looks like once I add the margin: 0 auto. Some of the short questions in my card shifted because it has flex and justify content space between. I tried text align left but it doesn't work. Would there be anyway to work on the text alone or it just the way it is?
0@Jos02378Posted about 3 years agoHey @nottohave, I don't entirely understand your question. What do you mean by your questions are shifted? Is it shifted in desktop size or mobile size? I tried adding
margin: 0 auto
to the card and the questions are not shifted both mobile and desktop. Did you add the margin to the section element with the class of card?0@nottohavePosted about 3 years agoHey Jos02378, thanks for the comment. First time I add margin: 0 auto to * { } and not section element class of card. I think that's why it causes the shift on the questions on both mobile and desktop view. I still haven't found time to watch and think about the links you sent. I will see if I can find any interests on it.
0 - For the space problem of the card, you can fix it by not setting a fixed height on the card. You can use a
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