51 Replies
the style doesnt work
container and conatiner 🙂
a typo
oh xD
thanks
np 🙂 dev tools are good for those sort of things 😄
could you also help me with my main problem, please?
what's the problem?
it doesent matters how big or small the hight or the width of the container is, the image always fits in there. The problem now is, that i dont set a borderradius or background color for the image anymore
than it would look like this
i hope you can understand it 🥲
you want something like this ? https://codepen.io/MannixMD/pen/oNQVKXZ
no, i want the border for the image
your image is not covering the whole element
try cover not contain in background-size
but i want, that the image still automaticlly fit inside the contanier, yk?
background-size: 100% 100%;
wait i try to explain again, its a bit hard 🥲
So the image has to fit in the container and all parts of the image have to be visible + the image needs a border
what border ?
sorry i mean border-radius
like this ? https://codepen.io/MannixMD/pen/oNQVKXZ
yea
i said you should set
background-size: 100% 100%;
earlier 😉wait 😅
its not the solution
i dont know how to say it in english xD
the image goes like ---------------->>>>>>>>>>>>>>>>>>>>
but i want that the scale? is the same
then it won't cover the whole container since it's to small
thats okay
how to do it?
Could you perhaps draw out what'd you'd like? And that might help us understand better 😄
okay, ill draw it 😅
Awesome 👍🏻
so the image must always have the same aspect ratios, and has to fit inside the container. And as extra, but its not such important, it should be centered in the middle of the container
and it needs a small borderradius
you gonna use img element instead of background-image https://codepen.io/MannixMD/pen/vYQPogp
Set a max width on the container, set the image inside to be height of a 100% and width of 80% and margin 0 auto
thannnkssssssss
thank you very much
oh no wait 🥲
is it possible to fix this?
don't put height on the #image ??
yea, but then it goes over the container
I'm sorry 🥲
you gotta make up your mind you either want the container to have 100px or 500px of width
or try setting max-width/height as snxxwyy suggested
yea its workinggggg
oh no wait 🥲
what?
jk jk 😄
xD oh man
thank you for your time
np
now it looks good this way
and this 😀
change the height of the container ?
yes
Heres the full code:
its so cool
if the width and height of container can be changed you will also need to change the image at the same time to achieve desired outcome
no its alright everything i wanted :D