자바스크립트에서 테두리로 사용할 이미지를 설정하려면 borderImageSource 이미지를 추가합니다.
예시
다음 코드를 실행하여 borderImageSource 작업 방법을 배울 수 있습니다. 이미지를 테두리로 설정하는 속성 -
<!DOCTYPE html>
<html>
<head>
<style>
div {
background-color:blue;
border: 40px dashed;
border-image: url('https://www.tutorialspoint.com/images/neo4j.png');
border-image-slice: 50;
border-image-width: 1 1 1 1;
border-image-outset: 0;
border-image-repeat: round;
}
</style>
</head>
<body>
<div id="box">
<p>Demo Text!</p>
</div>
<button onclick="display()">Set Inward Offsets</button>
<script>
function display() {
document.getElementById("box").style.borderImageSource = "url('https://www.tutorialspoint.com/images/bugzilla.png')";
}
</script>
</body>
</html>