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 component challenge using basic html and css

ris-hav 10

@ris-hav

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 would be the easiest shortest optimized way to execute this file?

Community feedback

@yigithancolak

Posted

Hi i liked your UI some much. It has a little bit different positioning than the original one but yours look better i think. For the code, i recommend you to look at semantic HTML codes. You should wrap the app inside <main> tag for making it semantic instead of using too many <div> tags it will make your code look more professional.

Marked as helpful

0
Ecem Gokdogan 9,380

@ecemgo

Posted

Some recommendations regarding your code that could be of interest to you.

HTML

  • In order to center the card correctly, you'd better remove <div class="container-fluid"> from html.

CSS

  • Then, you'd better add flexbox and min-height: 100vh to the body to center the card vertically and horizontally
body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}
  • If you use flexbox in the body, you don't need to use margin in the .main-div to center the card
  • If you use max-width instead of width, the card will be responsive
  • You'd better give padding to give a gap between the content and the border of the card
.main-div {
  /* width: 275px; */
  max-width: 275px;
  /* margin: 9% auto; */
  padding: 10px;
}
  • In addition to that above, in order to make the card responsive and the image positioned completely on the card, you'd better add width: 100% and display: block for the img in this way:
img {
  /* width: 250px; */
  /* height: 250px; */
  border-radius: 5%;
  /* margin-bottom: 5%; */
  width: 100%;
  display: block;
}
  • You don't need to use margin and width for p and you can remove them
p {
  /* width: 95%; */
  /* margin: 0 auto; */
}
  • Finally, you'd better remove .section-img to avoid the repetition if you want
/* 
.section-img {
  padding-top: 12px;
} 
*/

Hope I am 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