css attribute selectors

Syntax:

Attribute selector attributes need to be placed into the corresponding square brackets [], which contains the property name, identifier (* $ ~ ^ |)

Instructions for use:

[Attribute], for example, [target] selects all the elements with a target attribute.

[Attribute ~ = value] for example [title ~ = flower] denotes optional title attribute word contains all the elements "flower" is.

[ Attribute | = value ] for example [lang | = en] represents all the elements selected lang attribute value "en" beginning. This value must be a whole word, such as lang = "en", or followed by a hyphen - 

[ Attribute ^ = value ]], for example, a [src ^ = "https" ] represents selecting each element <a> its src attribute value "https" at the beginning of.

[ Attribute $ = value ], for example, a [src $ = ". Pdf "] src attribute which indicates to select ".pdf" all elements <a> end.

[ Attribute * = value ], for example, a [src * = "abc" ] represents select its src attribute comprising "abc" of each sub-element <a> strings.

 

Attribute selector and other selectors may be mixed, an intermediate space, comma> + waited in vain

Guess you like

Origin www.cnblogs.com/lizhiwei8/p/11516338.html