[id*=tion2]{ background: yellow; } [id^=sbu]{ background: yellowgreen; } [id$=\-0]{ background: royalblue; } a[href$=\/]:after,a[href$=htm]:after,a[href$=html]:after{ content: "web网页"; color:red; } a[href$=jpg]:after{ content:"jpg图像文件"; color:red; }