Responsive qr code component using mobile first workflow
Design comparison
Solution retrospective
Hello everyone, I have a doubt that the img element is inline but I can set my width and height . Can anyone help me out because we cannot set width to inline elements . so what is wrong here ?
Community feedback
- @kacperkwintaPosted almost 3 years ago
Some tips:
- Try to avoid static height, because on small screens text in box just overflow in bottom
- Page should contain a level-one heading
Marked as helpful1@sanketcharanpahadiPosted almost 3 years ago@kacperkwinta I can't set justify content property to vertically center the element if I do not manually set the height in many cases . What should I do then?
0 - @RioCantrePosted almost 3 years ago
Hello there! Nice work with this project! Looking at your solution, I think you should considered the following as well...
- Import the
attribution
style in the CSS file and removestyle
tag - Include description to the
alt
inimg
tag and should not be empty - Wrap the
attribution
with specific tag likefooter
for readability - Alternative way to set size on the image is to create a rule set that includes the tag property for example...
HTML: <div class="img"> <img src="./images/image-qr-code.png" alt="" class="qr" /> </div> CSS: .img img.qr { width:100% }
The issue would be you wrap the
img
first with.img
class then add another class within theimg
... the width would not be distinguish properly.Hope this helps and Keep it going!
Marked as helpful1 - Import the
- Account deleted
Hi there 👋
Congratulate on finishing your project 🎉. The design looks beautiful 😃.
I will try to answer your question and hope it helps you. Img tag is not a strictly
inline
element, it's areplaced-inline
element. Because<img>
is an inline tag, that is replaced by its own source file (well, it's still an inline element). See these links for more information MDNHappy coding ☕
Marked as helpful1
Please log in to post a comment
Log in with GitHubJoin 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