Question

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.

Was it helpful?

Solution

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

img[rel] {

}

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top