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 Website challenge using HTML and CSS

@surabhilssk

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


While positioning the images inside the <div> tag, the image is not behaving according to the sizing of <div> tag. How can I solve that?

Community feedback

@0xabdulkhaliq

Posted

Hello there 👋. Congratulations on successfully completing the challenge! 🎉

  • I have some recommendations regarding your doubts that I believe will be of great interest to you.

SUGGESTION 💡:

  • "While positioning the images inside the <div> tag, the image is not behaving according to the sizing of <div> tag. How can I solve that?". First we need to know why this issue is arised, It's just because the fixed width of img element.
  • Your code
img {
  width: 250px;
}
  • We can fix it by the following code
img {
   width: 100%;
}
  • Now the issue has been cleared.

.

I hope you find this helpful 😄 Above all, the solution you submitted is great !

Happy coding!

Marked as helpful

1
P
Larra 10

@larrasu

Posted

You can improve the look of the card by adding more padding to the contents of the card. It's a little bit compact compared to the original design. Overall, the card component looks great!

To answer your question, you can do so by doing this:

img {
    width: 100%;
    height: 250px; //specify image height
    object-fit: cover; // this keeps the image's aspect ratio and fills the given sizes
}

I hope this helps. Happy coding! ✨

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