ในการตั้งค่าคุณสมบัติเค้าร่าง ใช้ เค้าร่าง คุณสมบัติ. ช่วยให้คุณกำหนดสี ลักษณะ และออฟเซ็ตของเค้าร่างได้
ตัวอย่าง
คุณสามารถลองเรียกใช้โค้ดต่อไปนี้เพื่อตั้งค่าคุณสมบัติเค้าร่างทั้งหมดในการประกาศครั้งเดียวด้วย 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>