Responsive landing page using flexbox and other css basics
Design comparison
Solution retrospective
My first solution. I decided to improve my frontend skills to feel more confident with that. I'm still not good at it and don't know much about semantic html markups as well as flexbox. Waiting for constructive feedback thanks!
Community feedback
- @MelvinAguilarPosted almost 2 years ago
Hello there π. Good job on completing the challenge !
I have some suggestions about your code that might interest you.
HTML π·οΈ:
Alt text π·:
-
To make the alt attribute as useful and effective as possible, avoid using words such as "image", "photo", or "picture" as they are redundant because the image tag already conveys that information. Instead, try to make the description as human-readable and understandable as possible.
The alt attribute should explain the purpose of the image, for example, in the case of a QR code, a description like "qr code to frontendmentor.io" would be more appropriate.
If you want to learn more about the
alt
attribute, you can read this article. π.
CSS π¨:
- Instead of using pixels in font-size, use relative units like
em
orrem
. The font-size in absolute units like pixels does not scale with the user's browser settings. Resource π.
- Setting the width of the component with a percentage or a viewport unit will behave strangely on mobile devices or large screens. You should use a max-width of
320px
or20rem
to make sure that the component will have a maximum width of320px
on any device, also remove thewidth
property with a vw value.
- To center an element vertically, you should use a height to its container and add ``. In this case it is recommended to use "min-height: 100vh" so that it occupies 100% of the viewport height. e.g.:
main { min-height: 100vh; display: flex; justify-content: center; align-items: center; } .container { /* margin-top: 10vh; */ }
I hope you find it useful! π Above all, the solution you submitted is great!
Happy coding!
Marked as helpful1 -
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