Hello!
Congrats on finishing another project! Thanks for providing your thought process aswell as asking detailed questions! Here is my feedback:
- To me, this image isn't decorative. Anywhere an image adds any kind of value for sighted users, then alternative text should be provided so you should use
img
element withalt
text instead. If the image is in context, and is related to your content or adds something to it it's likely not decorative. read more - Answering your question why image-color isn't matching design. There should be some opacity on your image to make your blend color brighter. Normally you would put background-color on
.card-img
andopacity: 0.75
withmix-blend-mode
onimg
but since you went other approach withbackground-image
as you thought your image is decorative you can't put opacity on your.card-img
since it will change opacity for both container with background-color and image within. Instead use::before
pseudo-element on.card-img
and put your image there so you have both container and image in different elements. Don't forget to add position: relative to.card-img
.
position: absolute;
content: '';
background-image: url(images/image-header-desktop.jpg);
inset: 0;
mix-blend-mode: multiply;
opacity: 0.75;
- I wouldn't sweat about making your solution pixel perfect. Of course you want to match design but don't waste your time to move elements one pixel here and there. Later when you'll have access to figma and design files taking those measurements like spacings, sizing etc will be easier so you will match "pixel perfect" design.
- As for why you struggle with responsivnes. Look at mobile-first approach which is designing a desktop site starting with the mobile version, which is then adapted to larger screens. But since you make the other way around here's why it doesn't work for you. You should change
order
of flex-items when you switch to mobile screen size so your image is first, and content is second. Addorder: 1
to.card-info
. Next, you need to get rid of those explicitly set width/height values. You never want to do that. You want your content to take as many space as it needs and it will make you container width/height. Addmax-width: 1110px; width: 100%; flex-direction: column
to your.container
and remove width/height. Removewidth
from.card-info
and padding. Then add something likepadding: 1rem
. Remove width and set some height on your.card-img
likeheight: 400px; width: 100%;
so it take space within your container. Addpadding: 1rem
to yourbody
so your container doesn't stick to device edge of the screen. Removepadding-right
from.stats--item
. Now you have your mobile version. From there you can make it so it match desktop design. - You should definitely take a read how to make your solutions responsive. read more.
Have fun!
Marked as helpful