[wd_asp elements=’search’ ratio=’100%’ id=1]

Image selector using src not a class or id

8th May 2019

CSS

Css - Codehaven

I had a problem within a website that meant I could not change a logo throughout that I had used on all 160 pages! It did not have a unique identifying class or ID.
In mobile view the image was too small, the only way I could target whenever the image appeared was to use the code below. It saved me a few hours.

The star * denotes that it must contain the url stated.

img[src*="/wp-content/uploads/2018/12/parties.png"] {
width: 50% !important;
}