Image questions
Hi! I have two questions:
1. Why doesn't my
.image1
and img-box3 / image3
center the container when I put margin: 0 auto;
on them?
2. Why doesn't the background image show up on the .background
selector?
https://codepen.io/amarlong/pen/BaVxojb5 Replies
img is an inline element so that trick won't work
don't know much about the picture element
as for the
.background
check your css you are missing ;
to make it work 😉
and your url is wrong 🙂Fantastic! I think I fixed it now. Those pesky semicolons ... 🧐
Could i ask you one more question then. Why is the fit of the
.background
image so different from the .image3
? Obviously image3
changes with the orientation, but when it's portrait so much more of the image is in the frame than .background
.object-fit doesn't do anything on the
.background
you want to use background-size insteadBrilliant! So take away lesson: Background is background for a reason.
Thank you very much! 🙌
np 😉