ในการตั้งค่าคุณสมบัติเค้าร่างทั้งหมดในการประกาศครั้งเดียว ให้ใช้ โครงร่าง คุณสมบัติ. โดยกำหนดคุณสมบัติดังต่อไปนี้:outline-width, outline-style และ outline-color
ตัวอย่าง
คุณสามารถลองเรียกใช้โค้ดต่อไปนี้เพื่อเรียนรู้วิธีทำงานกับคุณสมบัติเค้าร่าง -
<!DOCTYPE html>
<html>
<head>
<style>
#box {
border: 2px dashed blue;
}
</style>
</head>
<body>
<div id="box">This is a div.</div>
<br>
<button type="button" onclick="display()">Click to set Outline</button>
<script>
function display() {
document.getElementById("box").style.outline = "5px solid red";
}
</script>
</body>
</html>