selector
attribute-suffix — CSS reference
Matches a nonempty ending of an attribute string. It is a text test, not URL parsing.
Formal Syntax & Structure
css syntaxcss
[attr$="suffix"]Working Example
Example Snippetcss
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Selector lab</title><style>:where(.sample) { color: rgb(32, 32, 32); }[data-file$=".pdf"] { color: rgb(0, 96, 80); }</style></head><body><p id="a" class="sample" data-file="guide.pdf">A</p><p id="b" class="sample" data-file="guide.pdf.txt">B</p></body></html>