Attribute selector là gì?

Phrase Css

Attribute selector chọn một phần tử (element) để tạo style dựa trên một thuộc tính và / hoặc giá trị thuộc tính. Ví dụ code dưới đây nhắm mục tiêu các phần tử thẻ p nhất định dựa trên sự tồn tại của thuộc tính "style":


/* matches elements with style="[anything]" */
p[style] {
  color: #1e1e1e;
}

Learning English Everyday