2

When using border-image CSS property, the border is placed outside of div. Is there any way to put the border image inside of div?

border-width: 50px;
border-image: url(Border.png) 50 repeat;
AzizAhmad
  • 637
  • 1
  • 9
  • 20

1 Answers1

1

Codepen link

Is that what you mean?

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;
}
knitevision
  • 3,023
  • 6
  • 29
  • 44