Design comparison
Solution retrospective
During this challenge, I had trouble getting the card to be responsive on a mobile screen. I initially set the height of my card to 80%, but needed to write a number of media queries in order to make the card responsive because as the height of the screen grew, the height of my card grew and a lot of white space was being added under my Cancel Order button. I eventually gave the card a fixed height. My question for you guys is whether or not giving the card a fixed height was the appropriate solution? Also, I would appreciate any other feedback you guys may have about my solution because my goal is to enhance my front-end skills, so any constructive criticism is welcomed.
Community feedback
- @ShreykrPosted about 3 years ago
Hi, I am in the same challenge right now, but am not able to understand the background images we have been given. I see that you have not included the background image in yours, but am trying to add it, and they have given images for Desktop and Mobile screens
So, is it like we have to detect if the device is a mobile screen and then apply the respective background svg ? Am confused actually
0@gianbarreto3Posted about 3 years ago@Shreykr I didn't even notice that there was a background image. Looks like I am going to need to add it. But to answer your question, seeming we were provided both a mobile and desktop background image, I believe we will have to use the mobile image for smaller screens and the desktop image for larger screens. So your assumption seems to be correct.
0@ShreykrPosted about 3 years ago@gianbarreto3 Yes, so that would require us to detect screen sizes and add background images accordingly?
I can think of a few ways to go about this since am using react. One would be to get the screen width using either the screen.width or the window.innerWidth and then conditionally (using If-else) load the div elements that add the appropriate background image. The if-else condition could be, say, the screen size you capture is > 480px, then add the desktop SVG, else add the mobile SVG background.
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