Design comparison
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.
Metadata ποΈ:
- The
lang
attribute is used to declare the language of the webpage. Add thelang
attribute to the<html>
tag with the valueen
.
-
The
viewport
meta tag is missing. theviewport
meta tag is used to control the layout of the page on mobile devices. Add theviewport
meta tag to the<head>
tag:<meta name="viewport" content="width=device-width, initial-scale=1.0">
.You can check your solution on a mobile device to see how your solution is distorted by not using this tag. β οΈ
HTML π·οΈ:
- Wrap the page's whole main content in the
<main>
tag.
- Always avoid skipping heading levels; Starting with <h1> and working your way down the heading levels (<h2>, <h3>, etc.) helps ensure that your document has a clear and consistent hierarchy. Source π
CSS π¨:
- To center the component in the page, you should use Flexbox or Grid layout. You can read more about centering in CSS here π.
body { /* padding: 20px; */ margin: 0; min-height: 100vh; display: grid; place-content: center; }
I hope you find it useful! π
Happy coding!
Marked as helpful2@Rafa-Ol-DevPosted almost 2 years ago@MelvinAguilar Thanks a lot for your suggestions ,they were really helpful!
0 - The
- @HassiaiPosted almost 2 years ago
Replace <div class="card"> with the main tag, <h2> with <h1> and <h4> with <h2> to fix the accessibility issues. click here for more on web-accessibility and semantic html
Give the body a background-color. Use the colors that were given in the styleguide.md found in the zip folder you downloaded.
To center .card on the page using flexbox or grid, add min-height:100vh; display: flex; align-items: center: justify-content: center; or min-height:100vh; display: grid place-items: center to the body.
To center .container on the page using flexbox: body{ min-height: 100vh; display: flex; align-items: center; justify-content: center; }
To center .container on the page using grid: body{ min-height: 100vh; display: grid; place-items: center; }
Use relative units like rem or em as unit for the padding, margin, width values and preferably rem for the font-size values, instead of using px which is an absolute unit. For more on CSS units Click here
Hope am helpful.
Well done for completing this challenge. HAPPY CODING
Marked as helpful1@Rafa-Ol-DevPosted almost 2 years ago@Hassiai Thank you very much for your suggestions. They were extremelly useful!
1
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