Css selecting image with changing href value?

Please refer to this image code:

<img class="logoimage" src="logo.png?6270707261906064847" onmouseover="/logo_hover_2x.png?6270707261906064847'" onmouseout="this.src='logo_2x.png?6270707261906064847'" alt="Dear Leader">

I am trying to select each specific image using css so i can control the size.

I tried this already:

.logoimage[src$="logo_2x.png"] { //*CSS }

I cannot seem to select the image because the src is changing ?xxxxxx.

Thanks Alex

Upvotes: 0

Views: 40

Answers (1)

kittyminky
kittyminky

Reputation: 485

The $= selector is for items ending with the specified attr. You want .logoimage[src*="logo_2x.png"] (which will match any .logoimage with that substring in the src)

http://www.w3.org/TR/css3-selectors/#attribute-substrings

Upvotes: 2

Related Questions