theonenonlybaby theonenonlybaby - 3 months ago 10
CSS Question

Targeting element without ID or Class with pure CSS

So here the thing, I got something like this:

blablabla
lots of code that change from time to time
blablabla

<center>
<a href="somewhere">
<img src="someUNIQUEaddress.gif">
</a>
</center>

blablabla
lots of code that change from time to time
blablabla


Now you see, I don't have any access to HTML and I can't use JS. I need somehow to target this, I know there's a way to target something like this:

[class="someUNIQUEthing"]


So perhaps there's a way like that to target the
src
of the img?

*EDIT:
LOL! I did it simply using this:

[src="myuniquething"]

Answer

You are searching for a equivalent to [class='someUNIQUEthing']. You can use the following:

img[src='someUNIQUEaddress.gif'] {
  border:2px solid red;
}
<img src="someUNIQUEaddress.gif">