A
A
Anton2018-05-18 14:44:20
Layout
Anton, 2018-05-18 14:44:20

How to set class for img tag by defining image extension in Less?

Tell me how to set the class for the img tag by defining the image extension?
More specifically, I need to set the style for the pictures

<img class="responsive-image" src="image/kartinka.svg">

but only if it's SVG , and if it's jpg then I want another class...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Goncharov, 2018-05-18
@isay777

You will not put down a class through less. And this is how you can style it depending on the format:

img[src$="svg"]{
  //стили для svg
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question