JavaScript에서 하나의 선언에서 테두리 하단 속성을 설정하려면 borderBottom 속성을 사용하십시오. border-bottom-width, border-bottom-style 및 border-bottom-color를 설정할 수 있습니다.
예시
다음 코드를 실행하여 테두리 하단 속성을 설정하는 방법을 배울 수 있습니다. −
<!DOCTYPE html>
<html>
<head>
<style>
#box {
border: 2px dashed blue;
width: 120px;
height: 120px;
}
</style>
</head>
<body>
<button onclick="display()">Set border bottom color</button>
<div id="box">
<p>Demo Text</p>
<p>Demo Text</p>
</div>
<script>
function display() {
document.getElementById("box").style.borderBottom = "thin dashed #000000";
}
</script>
</body>
</html>