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

QR Code - HTML and Vanilla CSS

EK 100

@EuphoriaCXI

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


Hi guys,

Thanks for taking the time to viewing my project.

I haven't touched any of the README files or text involving what is required for this project. I'm mainly after feedback for best practises. I really want to learn HTML and CSS, but as I am self taught I just wanted to make sure everything is solid before moving on to JavaScript.

I also just want to see if my code would be acceptable in a real world application.

Please feel free to be as critical as need be, every advice and tips means a lot to me.

Thanks so much for reading!

Community feedback

P
Fluffy Kas 7,735

@FluffyKas

Posted

Heyo,

Having some solid foundations before moving on to javascript is a great idea, it will save you from a lot of headache later. ^_^ Now some advice:

  1. It's best to center your component using grid/flexbox. Setting fixed margins won't work on every screen width, unfortunately. So you could add this to the body, for example:
display: grid;
place-items: center;
min-height: 100vh;
  1. Remove the height from your component, there's no need for it, in fact it is causing a bit of an overflow at the moment! Most elements have some default height that can be increased by adding padding, if needed.

  2. "qr-maintext" should be a heading and "qr-subtext" a paragraph, not the other way around ^_^

  3. Remove the <br> from your solution, that's used for other things. You could set a max-width on your element or add some padding left and right if you'd like the text to break at a certain point.

I hope this helps a bit!

Marked as helpful

1

EK 100

@EuphoriaCXI

Posted

@FluffyKas Hey!

Thanks so much for your feedback, I appreciate it.

I updated a second project I just completed using your grid example which worked out great. When using margins, would it still be okay to use margin: 0 auto; when I want a certain max-width to be respected on the page?

I'll make improvements on my semantic HTML.

Thanks again!

1
P
Fluffy Kas 7,735

@FluffyKas

Posted

@alwaysBeThankful Sure! Using margin: 0 auto and max-width is a good idea for centering most things. Centering elements with grid/flexbox like this will only work in specific use cases (meaning, you'll rarely have a single component dead centered in an empty page like in this challenge).

0

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