Flexbox, media query, css variable

Solution retrospective
This project marks the start of my frontend journey!
I have one extra question:
- Any way to determine what value to put for the media query min and max width? Currently I just select all screen sizes in Chrome dev tools and add media query when the page doesn't look good on certain devices.
Hope I can get some feedback for my solution & question Thank you in advance, and I really appreciate it! :)
Please log in to post a comment
Log in with GitHubCommunity feedback
- @PhoenixDev22
Hi Ken,
Congratulation on completing this challenge. Excellent work! I have some suggestions regarding your solution if you don’t mind:
- Page should contain
<h1>
. In this challenge , as it’s supposed to be a part of a whole page, you may use<h1>
withsr-only
class hidden visually and present for assistive tech users.
- In my opinion, the alternate text should indicate where the Qr code navigate the user : like
QR code to frontend mentor.
- Adding
rel="noopener"
orrel="noreferrer"
totarget="_blank"
links. When you link to a page on another site usingtarget=”_blank”
attribute , you can expose your site to performance and security issues.
Hopefully this feedback helps.
Marked as helpful - Page should contain
- @correlucas
Hello Ken, congratulations for this solution!
Answering your question:
In this solution you don't really need media queries since the card doesn't change too much, all you need to do is to make the card and the image responsive. To do that you need to make the card have a maximum size but also the ability to contract its size and also its content using
max-width: 320px
.To make the image responsive and resizing with the card size use
display: block
andmax-width: 100%
to make the qrcode image have the card with automatically.And that's it, no need for media queries.
If you’re not familiar to
media queries
andresponsivity
, here’s a good resource to learn it:https://www.w3schools.com/css/css_rwd_mediaqueries.aspHere's my solution for this challenge if you wants to see how I build it: https://www.frontendmentor.io/challenges/qr-code-component-iux_sIO_H/hub/qr-code-component-vanilla-cs-js-darklight-mode-nS2aOYYsJR
Hope this helps, happy coding
Marked as helpful
Join 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