Bộ chọn :only-of-type - Lặp lại
Nội dung trùng lặp với bài 1003062671. :only-of-type chọn phần tử là loại đó duy nhất trong cha.
Ví dụ (giống hệt bài trước)
<!DOCTYPE html>
<html>
<head>
<style>
p:only-of-type {
background: orange;
color: white;
}
</style>
</head>
<body>
<div>
<p>Văn bản 1 - CÓ nền cam</p>
</div>
<div>
<p>Văn bản 2</p>
<p>Văn bản 3</p>
<p>Văn bản 4</p>
</div>
</body>
</html>
"Văn bản 1" là p duy nhất trong div 1 → nền cam.