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 solution using technologies of HTML and CSS

@HalalisaniSibisi

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


What are you most proud of, and what would you do differently next time?

What I'm most proud is being able to gain more experience when it comes to the div elements, in most cases I tend to make mistakes if I have to do another div inside the div, which can confuse me when I style them.

What I can do differently is centering the div, I had a problem doing that especially since the qr code was in the the middle of the page so, I will try to improve on that.

What challenges did you encounter, and how did you overcome them?

When it comes to css, there are many elements you need to take into consideration especially when it comes to widths, margins etc, so that gave me a huge problem especially when I had to move the picture in the middle. I did a bit of some research on the Internet and that kind of helped to see where I went wrong.

What specific areas of your project would you like help with?

  • How can center it in the middle
  • How can I get I get the margins right without making everything complicated and confusing.
  • how can I make my layout be more responsive.

Community feedback

Levis Kimโ€ข 1,180

@Orekihotarou-k

Posted

Hi @HalalisaniSibisi ๐Ÿ‘‹

Great job on completing the challenge. Your solution looks wonderful. I love how you centered the div too.

I have some tips which may be of help to you.

  • I suggest wrapping the container with a main tag, or a div. This will come in handy when centering the div. For example:

if you wrap the container with the main tag, centering the div will be something like this:

main {
display: flex;
align-items: center;
justify-content: center;
min-height; 100dvh;
}

You can use the grid or the position methods to center the div too, but I recommend the grid or the flex method because they're easier to work with.

  • I also noticed that you forgot to add a semi-colon(;) after importing the fonts. This is probably affecting the asterix/general element selector. Also, set the box-sizing: border-box; in your general selector. With this set, the element's total width and height will include the content, padding, and border, all in one box. This should help with the margin and padding issues

  • By implementing the box-sizing: border-box, the issue with responsiveness will probably get fixed since you set the container max-width: 300px.

Also, I appreciate how you clearly stated areas in which you needed assistance. Thank you very much for doing that. It helps a lotโ˜บ๏ธ

I recently did a video in which I solved this challenge. You can check out my solution here @KimDoesCode. Please subscribe๐Ÿ˜… if it helps you out ๐Ÿซ 

Good luck on your coding journey ๐Ÿ‘‹โ˜บ๏ธ

Marked as helpful

0

@HalalisaniSibisi

Posted

@Orekihotarou-k Wow thank you so much, I'm really grateful for your feedback, this has been very informative and awesome advice. Can't thank you enough, I'll check it and I'll definitely subscribe ๐Ÿ˜๐Ÿ™๐Ÿฝโœจ๏ธ

0
Levis Kimโ€ข 1,180

@Orekihotarou-k

Posted

@HalalisaniSibisi You're most welcome๐Ÿ˜…โ˜บ๏ธ

0
P
Jake Godsallโ€ข 1,390

@jakegodsall

Posted

Hi ๐Ÿ‘‹

Just a note regarding the smaller viewports. There seems to be an issue with hard-coded width values on the container set at viewports smaller than 375px. One for 370px and one for 1440px. This is causing the content to overflow at smaller viewports.

A common approach for dealing with this would be to set a width using % values, and then setting a max-width for larger viewports. For example:

.container {
    width: 90%;
    max-width: 370px;
}

Hope this helps ๐Ÿ˜

Marked as helpful

0

@HalalisaniSibisi

Posted

@jakegodsall Thank you so much Sir, this has been very helpful๐Ÿ˜๐Ÿ™๐Ÿฝ

0
P
Jake Godsallโ€ข 1,390

@jakegodsall

Posted

@HalalisaniSibisi You're very welcome. Keep up the great work ๐Ÿ˜

0
Birushaโ€ข 60

@BirushaNdegeya

Posted

Hello @HalalisaniSibisi!

Your project looks great!

I have one suggestion for you to improve it even more:

Using margin is not the best option to center an element. Here's a very efficient (and better) way to place an element in the middle of the page both vertically and horizontally:

๐Ÿ“Œ Apply this to the body (in order to work properly, don't use position or margins):

body {
    min-height: 100vh;
    display: flex; 
    justify-content: center;
    align-items: center;
}

I hope it helps!

Happy Coding ...

Marked as helpful

0

@HalalisaniSibisi

Posted

@BirushaNdegeya Thank you for your feedback really appreciate it ๐Ÿ˜๐Ÿ‘Š๐Ÿพ. I get right into it and make it work as intended

0
Birushaโ€ข 60

@BirushaNdegeya

Posted

Hey there @HalalisaniSibisi !

Don't mention it! Feel free to ask any questions you have about coding, and I'll do my best to help you out.

Happy coding...

Marked as helpful

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