Actually, scrub that. The browser window wasn’t letting me get down quite small enough. I tried the built in Responsive Web Design Tester, and at phone sizes, all the images get clipped on the r/h side. Let me see if I can replicate the sizes you mention specifically
Your HTML has width & height attributes set for some of the images - effectively making them fixed width. I’m not sure the CSS is able to overrule that.
The problem is the adimg and you have not added responsive rules for it. That single image holds the whole page open so nothing in that section will get smaller.
Add this:
.adimg img{width:100%;height:auto}
CSS will always over-ride similar presentational html attributes including width and height attributes wherever set,
If you want to make exceptions to the 100% width then you need to add a new class to the image in question and set a width that you want for that image.
e.g. Add a class of conductor to the image.
.adimg img.conductor {width:150px;height:auto}
Do that for any images that you want special widths on.
Generally you would only add that rule in the media query or set a max-width equal to the images natural size to stop it getting too big.
If you want the image as only one on a line then set it to display:block.
Ok, I got things back to square1. I still can’t understand why in the http://pintotours.net/Europe/Spain/taxisBcn.html the code works, and here it does not. I am referring back to the plan above that get cut on the right with the earlier code. Paul solved it, but causes a problem further down,
I said add the class to the image not add another div around it.
img.conductor
That means you should have added class=“conductor” to the image tag.
If you want the small images side by side (assuming there is room) then you would set them to display:inline using that unique class otherwise you will change all the other images.
To center inline images you need text-align:center on a block parent of that image. In your case that would be on .img-container or .ad-img. Of course this will affect all images using that class but I guess as the other images are display:block it will not affect anything.
In that page the natural height of the image is about a third ofg its width (250x99) but in the other page the natural height of the image is twice its widths (125x262). That means that when you scale it the height will always be twice the width in order to maintain its aspect ratio. As I said before just add a max-width of 125px if you don’t want it to scale bigger but still scale smaller when needed.
Sorry Paul, but is not possible to address the earlier problem of images being cut on the right without affcting this conductoe and the other image whioch display fine in the current live page?
Come on you know what’s wrong with that you’ve been doing this long enough now
When you another class to something you don’t add another class attribute you just add the class as a space separated list.
e.g.
class=“one two three”
not class="one class=“two”
You still haven’t put the class on the image so you are not going to be able to give it special rules and you also put the class as img.conductor which is css not html.
You don;t need that extra img-container either so do something like this:
I explained that. It doesn’t display: fine its just a small height image. If you tell your conductor to lie down then take an image of him it will be the same