Mangled
Mangled

Reputation: 329

If Image Width = 250 CSS

Is there a good CSS3 way of styling the img tag if it has a certain width without having to include a class to the image. (Perhaps using something like the

@media

queries)

Upvotes: 0

Views: 1641

Answers (1)

Nikhil Patel
Nikhil Patel

Reputation: 1781

If the width is specified in the HTML like :

<img src=".." width=250>

Then you can use this CSS :

img[width='250'] {
    /* style */
}

Fiddle

Upvotes: 4

Related Questions