I’m using css-border-image to put TV show posters into an image of a horizontal TV that has a stand at the bottom, so the image isn’t supposed to be centered in the border-image – I want to get it to go a little higher up, or stretch the border-image vertically so the image fits in the right place.
.tv {
height: 170px;
border: 9px solid transparent;
border-image: url("https://i.stack.imgur.com/xyxRN.png") 15 stretch;
}
<img class="tv" src="https://m.media-amazon.com/images/M/MV5BOWFjODRhMDktMTE3My00ODQzLThmODctYmM2ZmU5YmY0ZGVkXkEyXkFqcGdeQXVyMjkwOTAyMDU@._V1_.jpg">
Things I’ve tried:
- Adding a
border-bottom: 20px
line (this only stretches out the TV stand) - Using
round
andstretch
with different numbers - Using
border-image-outset
- Trying
border-image-slice
Can I make the image not be centered in its border-image? Please tell me there’s a solution that only edits the css in .tv
without having to put it in a container!
2
Answers
Some padding with background-image would be easier
You can try to find some fitting values for
border-image-slice
: https://developer.mozilla.org/en-US/docs/Web/CSS/border-image-slice