Answer the question
In order to leave comments, you need to log in
How to wrap an img tag in a div?
there is a site on joomla, materials are displayed on the main page in a short form .... some have images in the preview, some do not, the task is to find these images and wrap them in a div with a given class ... if someone tells me how to do this, I will be very thankful...
Answer the question
In order to leave comments, you need to log in
I recommend that you use jQuery, find all the img you need, and then use the wrap() function to wrap it in a div.
$(".container img").wrap("<div></div>"); // находишь все img в элементе с классом container, после чего оборачиваешь их div'ом
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question