質問

Every time an image is uploaded in wordpress, it receives a different rel atribute, for example rel="attachment name123", and I want to select every image with a rel atribute, regardless of their name. Is this possible?

EDIT: Actually they are links so thanks to the answers the correct way to select links is:

a[rel] {pointer-events: none; cursor: default;}

That's for removing the links.

役に立ちましたか?

解決

You can select all images with a rel attribute defined by:

img[rel] {

}

他のヒント

This selector should work: img[rel].

According to CSS specification:

5.8 Attribute selectors

CSS 2.1 allows authors to specify rules that match elements which have certain attributes defined in the source document.

5.8.1 Matching attributes and attribute values

Attribute selectors may match in four ways:

[att] Match when the element sets the "att" attribute, whatever the value of the attribute.

See this DEMO.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top