Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Responsive QR code page

@markvarga21

Desktop design screenshot for the QR code component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


  1. I am always struggling with the responsiveness of a page, because okay, in this solution it looks fine on screens having a width of 400px and 1440px, but other than that, it just almost crashes the whole page. Is it because I use the rem relative units of CSS?

Community feedback

P
Katrien S 1,070

@graficdoctor

Posted

It has nothing to do with using rem. As you're supposed to be using them when you want to make things responsive. This seams to me to be the culprit: width: 17svw; on your #qr. Which on smaller screens you give a 75vw. This means on tablets and smartphones, the qr will take up about 75% of the screen width. But on desktops, it will shrink down to 17%. What you need to do here is, give your div id='qr' a max-width. There is various ways you could write this, but an example could be:

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

#qr {
	width: 95vw;
	max-width: 350px;
	margin: 0 auto;
}

Here we tell the div you need to be 95% of the viewport, until your maximum 350px wide.

Are you familiar yet with how the box-model works in css? CSS Box Model And what the purpose is of this code I added:

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

Also, don't use div to write headings or text. There are html-tags especially for text. HTML Text Formatting

Marked as helpful

1

Please log in to post a comment

Log in with GitHub
Discord logo

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