@vanzasetia
Posted
Hello, KurtJF! π
Congratulations on completing your first Frontend Mentor challenge! π
Regarding your questions:
- It's possible to finish this challenge without using any
div
elements. I suggest removing thediv
with the class of.card
. Also, it's not a necessary thing to wrap the text elements (h1
andp
) with adiv
. I suggest making those elements as the child elements of themain
element. For the attribution, you can swap thediv
with afooter
instead. - I think you have done a great job on using CSS custom properties. But, it's hard to tell how well it is since the project is a small project though. π
Some suggestions from me.
- The alternative text for the QR code can be improved. Try to tell the users about the QR code. By the way, have you tried to scan the QR code?
- I recommend adding
width
andheight
attributes to each image element. This way, the browser knows how much space the image requires before it can be fully loaded. As a result, it would optimize CLS (Cumulative Layout Shift). As a side note, it is not the same aswidth
andheight
CSS properties. So, make sure you learn how to use them.
That's it! I hope you find this useful! π
Marked as helpful
@vanzasetia Thank you for your detailed response regarding my questions! It really helped a lot, Also I have updated my solution.
If you don't mind me asking, How can I tell if the div
is not needed?
Again thank you very much for the comments and I will keep them in mind when tackling the other challenges. π
@vanzasetia
Posted
@KurtJF Happy to hear that was helpful! π
In this case, you don't need any div
because you can use the main
element as the container of the elements inside it. Also, the attribution
should be a footer
to fix the issue that has been reported.
In general, you want to keep the HTML markup as simple as possible. So, I recommend trying to write as minimum HTML as possible. After that, if it needs div
to wrap the elements in order to create two-column layouts then use a div
.
The point is to use div
when it is needed. π
By the way, good job with the update! The HTML markup looking good to me. π
Marked as helpful