HTML DOM borderImageOutset 속성은 배경 이미지 영역이 요소 테두리 상자를 확장하는 값을 설정하거나 반환하는 데 사용됩니다. 위쪽, 왼쪽, 오른쪽 및 아래쪽에 대한 값을 사용하여 요소의 각 테두리에서 배경 이미지가 확장되는 정도를 지정할 수 있습니다.
구문
다음은 −
의 구문입니다.borderImageOutset 속성 설정하기 -
object.style.borderImageOutset = "length|number|initial|inherit"
속성 값은 다음과 같이 설명됩니다 -
| 값 | 설명 |
|---|---|
| 길이 | 이미지가 테두리 상자에서 확장되는 거리를 정의합니다. 기본값은 0으로 설정됩니다. 즉, 테두리 상자를 넘어 확장되지 않습니다. |
| 숫자 | 경계 너비의 배수인 숫자 값을 정의하는 경우. |
| 초기 | 이 속성을 초기 값으로 설정합니다. |
| 상속 | 상위 속성 값을 상속하려면 |
예시
borderImageOutset 속성의 예를 살펴보겠습니다 -
<!DOCTYPE html>
<html>
<head>
<style>
#P1 {
border: 20px solid transparent;
margin: 20px;
border-image: url("https://www.tutorialspoint.com/tensorflow/images/tensorflow.jpg") 30
round;
border-image-outset: 5px;
background-color: lightgreen;
}
</style>
<script>
function changeBottomOutset(){
document.getElementById("P1").style.borderImageOutset="20px";
document.getElementById("Sample").innerHTML="The border image outset is now
increased";
}
</script>
</head>
<body>
<h2>Demo Heading</h2>
<p id="P1"> This is a sample paragraph containing some text. This paragraph is created only for the sake of this example</p>
<p>Change the above div border image outset by clicking the below button</p>
<button onclick="changeBottomOutset()">Change Bottom Outset</button>
<p id="Sample"></p>
</body>
</html> 출력
이것은 다음과 같은 출력을 생성합니다 -

"테두리 외곽선 변경" 버튼을 클릭하면 -
