Forum Moderators: not2easy
img {
max-width: 100%;
/*min-width: 130px;*/
height: auto;
} <div><div><img class="pics alignleft wp-image-100 size-full" width="250" height="167" /></div><div><img class="pics wp-image-200 size-full" width="250" height="167" /><br class="clear" /></div></div>
<br class="clear" />
.block-type-content div.entry-content img {
max-width: 45%;
height: auto;
} <div-img1 class="picturepair"><img1></div>...<div-img2 class="picturepair"><img2</div> <div><div-img1 class="picturepair"><img1></div>...<div-img2 class="picturepair"><img2</div></div> <div class="picturepair"><div-img1><img1></div>...<div-img2><img2></div></div> .block-type-content div.entry-content img {
max-width: 100%;
height: auto; <div class = "picpair">
<img blahblah
<span class = "gap"> </span>
<img blahblah
<p class = "caption">Descriptive text</p>
</div> <div class = "pictrio">
<img blahblah
<span class = "gap"> </span>
<img blahblah
<span class = "gap"> </span>
<img blahblah
<p class = "caption">Descriptive text</p>
</div> <br class="clear" />
div.twopic_container {float if you want; size as needed}
div.twopic_container img:first-child {margin:0px 4% 0px 0px; width:45%; height:auto;}
div.twopic_container img:last-child {margin:0px 0px 0px 4%; width:45%; height:auto;} <div class="twopic_container">
<img src="a.jpg"><img src="b.jpg">
</div> In WP the extra gap element doesn't work. I suppose the automatic floating of "alignleft images" in WP pushes it to very right side. Besides WP encourages to set image margins by webmasters stylesheet.If at all possible with WP, do not assign "alignleft" or "alignright" classes or any other automatic floating properties to those images, or weird stuff may happen.
Hm, 4% for each image. I gave the left image 8% margin-right, no margin for the right image.It's the sum of margins that matters. I just split them in my example for the sake of symmetry...
The width of some image pairs is not exactly equal, for exampleIf their pixel width is different, then you need to adapt their percentage width accordingly:
left image: 240, right image 250.
Responsive resizing then creates different HEIGHTS.
Some of the pics become unsharp on smartphones (320px). Surprising, isn't it? A small pic of 250px in good quality should be resized less than 50% without becoming unsharp.That points to an outdated browser using an inadequate interpolation algorithm.
Uploading images with WP you have to choose: alignleft, alignright, aligncenter, alignnone. As I need "floating" and the left images should be placed on the left side I have to choose alignleft.You want the container div to float (if at all), and not the images within. If the scaling of the images with all margins sums up to less than 100% horizontally, then they will get arranged next to each other without floating themselfes.
<img ...> <img ...> - space (or newline etc.) character requires extra room
<img ...><img ...> - no space, no problem
Then I had to start my layout from scratch again.
div.sharedpicture {column-width: 260px; column-gap: 10xp;} As far as I know "float" and "clear" belong together as standard CSS properties
With "alignnone" I have to find another way to let both images display side by side, for example "display: inline-block".I'm not sure why you think so. As long as the total width of the images is less than 100%, displaying side by side within the parent div is what happens by default. If it doesn't, then maybe you have some other margins/borders/padding (of the images or the container div) interfering. In that case, you should either remove those or include them in your width calculations.
it's "WP behaviour", i.e., not telling clearly what they doMost browsers will show you in their webmaster-"inspector" tools which styles they apply and what box model measurings result from them. That might help you figure out what actually happens.
As long as the total width of the images is less than 100%, displaying side by side within the parent div is what happens by default.
Does it also do that in the "mobile emulation" mode of Chrome or Firefox?
If so, please check in the inspector what the actual width, padding, and margin values of all involved elements are.
Without this information the discussion will keep going in circles.