如何将边框图像放入 div

how to put border image inside of div

当使用border-imageCSS属性时,边框放在div之外。有什么方法可以把边框图片放在 div 里面吗?

border-width: 50px;
border-image: url(Border.png) 50 repeat;

Codepen link

你是这个意思吗?

HTML

<div>
 <span>

 </span>
</div>

CSS

div {
  border: 1px solid black;
  width: 200px;
  height: 200px;
}

span {
  box-sizing: border-box;
  display: block;
  width: 200px;
  height: 200px;
  border-width: 50px;
  border-image: url(https://www.castlejackpot.com/wp-content/uploads/dynamik-gen/theme/images/home-horizontal-border.png) 50 repeat;
}