Design comparison
SolutionDesign
Solution retrospective
- In landscape mode, the top is getting cut, love to get some ideas on how to fix that
- I am using scale on the container. Is there any other way to get the same result.
- For some reason, the horizontal margin is not working properly.
- Any other code suggestions.
Community feedback
- @MelvinAguilarPosted 11 months ago
Hello there π. Good job on completing the challenge !
I have some suggestions about your code that might interest you.
- Use
min-height: 100vh
instead ofheight
. Setting the height to 100vh may result in the component being cut off on smaller screens, such as a mobile phone in landscape orientation.
- Using
scale
might cause issues if you use a very small number; you'd have to guess the width of the element.
- The component hits the edges on some devices because the image has a default fixed width. Since the component doesn't resize, the margin may seem ineffective. To fix this, use
max-width: 100%;
on the image so that it can adapt to the device and remove thescale
property.
- You should use the
box-sizing: border-box
property to make thewidth
andheight
properties include the padding and border of the element. This will make it easier to calculate the size of an element. You can read more about this here π.
- Use semantic elements such as
<main>
and<footer>
to improve accessibility and organization of your page.
I hope you find it useful! π
Happy coding! ππβοΈ
Marked as helpful2 - Use
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