随记-CSS对元素进行属性选择匹配

示例代码:
span[title="JavaScript"] { color: yellow; } span[title~="backbone"] { color: grey; } span[title*="safety-and-perf"] { color: indigo; } span[title^="python" i] { color: skyblue; } span[title$="Go."] { color: crimson; } span[title|="TypeScript"] { color: #3178c6; }
<span title="JavaScript">JS</span> <span title="The durable backbone of enterprise systems: Java.">Java</span> <span title="Rust is the safety-and-performance choice for systems programming.">Rust</span> <span title="Python is the accessible gateway to AI and data.">Python</span> <span title="The pragmatic language of cloud-native infrastructure: Go.">Go</span> <span title="TypeScript-Language is the engineering standard for large-scale frontends.">TS</span>
浙公网安备 33010602011771号