@correlucas
Posted
👾Hello @devwinner-sek, Congratulations on completing this challenge!
I saw your preview site and I liked a lot the work you’ve done here, it's almost complete, I’ve some suggestions you can consider applying to your code:
1.Use <main>
instead of <div>
to wrap the card container. This way you show that this is the main block of content and also replace the div with a semantic tag.
2.Use units as rem
or em
instead of px
to improve your performance by resizing fonts between different screens and devices. These units are better to make your website more accessible. REM does not just apply to font size, but to all sizes as well.
3.Something you can do to improve the image that needs to change between mobile and desktop is to use <picture>
instead of <img>
wrapped in a div. You can manage both images inside the <picture>
tag and use the html to code to set when the images should change setting the device max-width
depending of the device (phone / computer) Here’s a guide about how to use picture
: https://www.w3schools.com/tags/tag_picture.asp
✌️ I hope this helps you and happy coding!
Marked as helpful
@devwinner-sek
Posted
@correlucas Thanks very much for your suggestions. I have a great issue with responsive using only HTML + CSS. My goal is to master HTML CSS (i used bootstrap before).
Once again, thanks.
@devwinner-sek
Posted
@correlucas Please a question:
I saw the case i can use picture : <picture>
<source media="(min-width:650px)" srcset="img_pink_flowers.jpg"> <source media="(min-width:465px)" srcset="img_white_flower.jpg"> <img src="img_orange_flowers.jpg" alt="Flowers" style="width:auto;"> </picture>It's very helpful.
But please i have a question:
By using img in HTML, can i give a background color to the image ?
I have used background image in this challenge because of the issue of background color for the image:
.card-right { border-radius: 8px 8px 8px 8px; background-image: url("../images/image-header-mobile.jpg"); background-color: #aa5cdb; background-blend-mode: multiply; background-repeat: no-repeat,repeat; }
@correlucas
Posted
@devwinner-sek is the same thing you can use img
to apply the color to the image using the main selector for the image instead of using background-image
its also better to do it using img
than the css.
Marked as helpful
@devwinner-sek
Posted
@correlucas Ok thanks