Html & CSS using flexbox and picture tag

Solution retrospective
I was facing some problems.
picture::before {
content: '';
position: absolute;
top: 0;
left: 0;
background: var(--soft-violet);
mix-blend-mode: multiply;
width: 100%;
height: 446px;
}
In this ::before selector, initially i made height = 100%, But I was getting image size (height) less than the picture tag, I couldn't figure out why, so I made height of the ::before equal to the height of the image.
Can anyone help me why I was having that height of image & picture tag problem?
Please log in to post a comment
Log in with GitHubCommunity feedback
- @santu369
Hi Vatsal,
By default,
img
element is displayed as inline-block. You can change it todisplay: block
and addheight: 100%
orright: 0; bottom: 0;
topicture::before
, this should solve the problem you were facing.Good job on finishing the challenge 🙌
- @Kanonkongen-dk
Hi Vatsal,
instead of setting a height and width, try this.
right: 0;
bottom: 0;
That worked for me.
Best regards Lasse
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