attribute selectors

selector

notes

[attribute="value"]

select elements with a specified attribute and value

[attribute^="value"]

attribute begins with a specified value (doesn't have to be a whole word).

[attribute$="value"]

attribute ends with a specified value.

[attribute*="value"]

attribute contains a specified value.

[attribute~="value"]

attribute value containing a specified word.

โญ๏ธ ๆณจๆ„๏ผš่ฆใ€Œๆ•ดๅ€‹ๅ–ฎๅญ—ใ€ไธ€ๆจฃๆ‰็ฎ—โ—๏ธ

ๅปๅˆ๏ผš"value is", "my value"

ไธๅˆ๏ผš"values", "my-value"

[attribute|="value"]

attribute starting with the specified value.

ๅปๅˆ๏ผš"value", "value-key" (followed by hyphen)

ไธๅˆ๏ผš"values"

Last updated