개요 속성을 설정하려면 개요를 사용하십시오. 재산. 윤곽선의 색상, 스타일 및 오프셋을 설정할 수 있습니다.
예시
다음 코드를 실행하여 JavaScript를 사용하여 하나의 선언에서 모든 개요 속성을 설정할 수 있습니다 -
<!DOCTYPE html>
<html>
<head>
<style>
#box {
width: 450px;
background-color: orange;
border: 3px solid red;
}
</style>
</head>
<body>
<p>Click below to add Outline.</p>
<div id="box">
<p>This is a div. This is a div. This is a div. This is a div. This is a div.</p>
<p>This is a div. This is a div. This is a div. This is a div. This is a div.</p>
<p>This is a div. This is a div. This is a div. This is a div. This is a div.</p>
</div>
<br>
<button type="button" onclick="display()">Set Outline</button>
<br>
<script>
function display() {
document.getElementById("box").style.outline = "thick solid #5F5F5F";
}
</script>
</body>
</html>