Design comparison
Solution retrospective
I hope you like my solution. Is there a more effective way of setting different images for different displays and how do I use the picture element? Also, please what is linear gradient is and how do I set it for image overlay?
Community feedback
- @md5daltonPosted about 2 years ago
Hi there Ebere. Congratulations on finishing the challenge.
The
picture
element is perfect for displaying images for each different screen size. Here's a link to MDN web docs if you're interested in learning more about how to use it: The Picture element.Regardless I'll leave an example below on how you can implement it in your code:
<picture> <source srcset="/images/image-header-desktop.jpg" media="(min-width: 576px)" /> <img src="/images/image-header-mobile.jpg" alt="image" /> </picture>
The linear-gradient() CSS function creates an image consisting of a progressive transition between two or more colors along a straight line. This is also from MDN web docs and here's the link: linear-gradient.
I didn't notice any gradient in the design but either way I'll leave an example below on how you can implement it:
/* angle | color-start | color-stop */ background: linear-gradient(transparent, hsl(277, 64%, 41%));
I hope that gives you an idea on how you can implement itπ
Marked as helpful0 - @omarsaleh11Posted about 2 years ago
**congratulation on finishing this challenge **
and look at this site if u wanna know about [picture tag] (https://www.w3schools.com/tags/tag_picture.asp)
if u wanna make the img like the design make the background the color that u want then
img { opacity: 0.75; mix-blend-mode: multiply; }
and this site can help with making [linaer gradient colors] (https://cssgradient.io/)
Marked as helpful0@eby-coderPosted about 2 years ago@omarsaleh11 Thank you. But I tried using the steps that W3schools (https://www.w3schools.com/tags/tag_picture.asp) provided for the picture element before and it didn't work. Is there anything I should be doing that I'm not?
0@omarsaleh11Posted about 2 years ago@eby-coder np,
try to look at my solution here ( https://www.frontendmentor.io/solutions/stats-preview-card-component-using-css-flex-and-grid-vZcHmUVjWx )
0
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