Responsive land page using HTML and CSS
Design comparison
Solution retrospective
I am open for feedbacks and suggestions. If you have something that you think that would be better or would be a better practive, I would be happy to learn.
Community feedback
- @HassiaiPosted almost 2 years ago
Replace <div class="card"> with the main tag and <p class="card_title"> with <h1> to fix the accessibility issue. To .card on the page, add min-height:100vh; display: flex; align-items: center: justify-content: center; or min-height:100vh; display: grid place-items: center to the body. replace the margin value in .card with
margin: 0 auto;
For a responsive content that wont require a media query for this challenge, replace the width of .card with a max-width and the height value with auto or a padding value for all the sides in place of the height. Give .cube-image a max-width of 100% instead of a fixed width and height value.
Give h1 and p the same padding left and right value and give h1 the same margin to and bottom value.
Use rem or em as unit for the padding, margin, width and preferably rem for the font-size for more on CSS units watch this https://youtu.be/N5wpD9Ov_To
Hope am helpful. HAPPY CODING
Marked as helpful0 - @MelvinAguilarPosted almost 2 years ago
Hi there ๐. Good job on completing the challenge ! I have some feedback for you if you want to improve your code.
HTML:
- Use the
<main>
tag to wrap all the main content of the page instead of the<div>
tag. With this semantic element you can improve the accessibility of your page.
- You must use a level-one heading (h1) even though this is not a full-page challenge. You can create an '<h1>' element within your 'main' element that will be hidden visually but visible and readable by screen readers. The class "sr-only" hides content visually and here are the styles to copy. e.g.:
<h1 class="sr-only">QR Card Component</h1>
- The
alt
attribute should explain the purpose of the image. Uppon scanning the QR code, the user will be redirected to the frontendmentor.io website, so a betteralt
attribute would beQR code to frontendmentor.io
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. This can cause accessibility issues for users who have set their browser to use a larger font size. You can read more about this here.
- The container isn't centered correctly. You can use flexbox or grid layout to center elements. You can read more about centering in CSS here.
I hope you find it useful! ๐ Above all, the solution you submitted is great!
Happy coding! ๐
Marked as helpful0 - Use the
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