+ 1
What can I do to set the background-image size to 100% inside a border? Or is it not possible?
In a paragraph element, I created a border, set the width and height to 50%. And set the background image, the size of thr image is pretty big. And now only half (top-left to the other half) shows up since the paragraph is on the left side.
4 Réponses
+ 3
Normally it should be 100% inside the border… Do you habe Padding? When you have 0 Padding it should work
+ 2
You can use background-size: 100% 100%;
to set size of background image to fit full container.
Sometimes this is not enought and you need to play with other properties like background-repeat, background-position, or other background-size values
Check this guide for background size
https://css-tricks.com/almanac/properties/b/background-size/
+ 1
I'll try it tomorrow, too exhausted rn, thanks for answering 😊
+ 1
PanicS alright, thank you 😊