I already have a wordpress website with many images in posts. I’m creating a new theme using bootstrap but it seems like the images are crossing the container area.
Bootstrap provides a built-in class :
class="img-responsive"
but this code needs to be inserted in all the <img>
tags which is a lot of work.
What is the other way to make the images responsive?
Also, this code doesn’t work –
img
{
border: 0 none;
max-width: 100%;
vertical-align: middle;
}
It just squeezes the image inwards.
There is a gist showing how to do this at https://gist.github.com/mkdizajn/7352469
The technique is to add the following to your functions.php (from gist):
You should consider creating a child theme to make this modification if you are using a stock theme.