ใช้ CSS:ตัวเลือกลูกคนสุดท้ายเพื่อจัดรูปแบบทุก
องค์ประกอบที่เป็นลูกคนสุดท้ายของแม่ คุณสามารถลองเรียกใช้รหัสต่อไปนี้เพื่อใช้งาน:ตัวเลือกลูกสุดท้าย
<!DOCTYPE html>
<html>
<head>
<style>
p:last-of-type {
background: orange;
}
</style>
</head>
<body>
<h2>Heading</h2>
<p>This is demo text1.</p>
<p>This is demo text2.</p>
<p>This is demo text3.</p>
</body>
</html>