I’m using thumbnail and caption classes of bootstrap. But all my images are not of the same size. To make their size equal I added this in my img tag and it works perfectly making all the thumbnails equal
As Sam said you need to get friendly with your web inspector and find out the weight of the rules that over-ride your own and then match with a similar weight.
e.g.
You may have to do something like this:
img.img-responsive.pic-resize{
styles here etc ...
}
It may be that you have rules using the thumbnail class so you may have to add more weight.
e.g.
.thumbnail img.img-responsive.pic-resize{
styles here etc ...
}
I don’t know Bootstrap well at all, but I believe those are the css properties assigned to the class .img-responsive in Bootstrap.
So simply removing that class form the image may be a simpler and more effective solution.
I tried removing the img-responsive class but it didn’t work.
Maybe because the img tag is inside the .thumbnail class. And height was set to auto in .thumbnail>img.
To make my CSS code shorter, I replaced that long part with this code to overwrite the .thumbnail>img part only. It’s working.
The first rule of bootstrap is not to directly change the source code. Generally you should make changes via your custom CSS using over-rides otherwise you risk breaking the whole framework or being unable to update at a later date. Bootstrap classes are used site-wide and have expected behaviours and if you change the core class then you change it everywhere and unless you have taken into account all the implications of that class, which may pass through multiple media queries, then you could end up in trouble.
For example your first attempt would likely have broken any carousels that may have been introduced because the rule was being used for those.
By setting all images to 150px width and height you have killed any responsiveness and now images in that region will not shrink or grow. This may be OK in isolation but in the concept of a framework you have just broken a number of golden rules:). Much better to add a unique class for this situation and to use in similar situations and avoid breaking the framework.
When you use a framework you should follow its guidelines otherwise you may as well roll your own to start with