Monday, September 07, 2009

Arranging Pictures In Your Posts, Side By Side

Having published Arranging Pictures In Your Posts, which hopefully explains several frequently asked questions
  • How do I get my pictures into the middle of the posts?
  • Why aren't my pictures clickable, to show the full size content?
  • Why do I always have to move the pictures from the top, into the text?
I find that there's a fourth question that gets asked.
How do I display pictures next to each other, not on separate lines?
This question, I would typically answer by advising
Use nested tables.
That makes an effective workaround, although a clumsy one.

But it's possible to simply float pictures side by side, if they are small enough to fit into the space provided. That's not so hard to do, just make them small.

Here are two pictures, as I would normally set them up.








<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_pzC_7PLtN-0/SqVtLtQ-psI/AAAAAAAACMI/QGLCaRhCPtA/s1600-h/DSCF0048.JPG" target="_blank"><img style="border-width:0px; float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand; width:320px; height:240px;" src="http://4.bp.blogspot.com/_pzC_7PLtN-0/SqVtLtQ-psI/AAAAAAAACMI/QGLCaRhCPtA/s320/DSCF0048.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5378825377860724418" /></a>
<br clear=left />
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_pzC_7PLtN-0/SqVtLM37lKI/AAAAAAAACMA/db5mR8RGXw8/s1600-h/DSCF0018.JPG" target="_blank"><img style="border-width:0px; float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand; width:320px; height:240px;" src="http://3.bp.blogspot.com/_pzC_7PLtN-0/SqVtLM37lKI/AAAAAAAACMA/db5mR8RGXw8/s320/DSCF0018.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5378825369165730978" /></a>
<br clear=left />


Besides the size problem - those pictures will not fit next to each other, given the space in most browser windows - there is another reason why you do not see them side by side.
<br clear=left />


So, make the pictures smaller, remove the break between the two pictures, and what do you get?





<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_pzC_7PLtN-0/SqVtLtQ-psI/AAAAAAAACMI/QGLCaRhCPtA/s1600-h/DSCF0048.JPG" target="_blank"><img style="border-width:0px; float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand; width:160px; height:120px;" src="http://4.bp.blogspot.com/_pzC_7PLtN-0/SqVtLtQ-psI/AAAAAAAACMI/QGLCaRhCPtA/s320/DSCF0048.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5378825377860724418" /></a><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_pzC_7PLtN-0/SqVtLM37lKI/AAAAAAAACMA/db5mR8RGXw8/s1600-h/DSCF0018.JPG" target="_blank"><img style="border-width:0px; float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand; width:160px; height:120px;" src="http://3.bp.blogspot.com/_pzC_7PLtN-0/SqVtLM37lKI/AAAAAAAACMA/db5mR8RGXw8/s320/DSCF0018.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5378825369165730978" /></a>
<br clear=left />


Or even smaller, if you want to put half a dozen pictures there.





<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_pzC_7PLtN-0/SqVtLtQ-psI/AAAAAAAACMI/QGLCaRhCPtA/s1600-h/DSCF0048.JPG" target="_blank"><img style="border-width:0px; float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand; width:80px; height:60px;" src="http://4.bp.blogspot.com/_pzC_7PLtN-0/SqVtLtQ-psI/AAAAAAAACMI/QGLCaRhCPtA/s320/DSCF0048.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5378825377860724418" /></a><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_pzC_7PLtN-0/SqVtLM37lKI/AAAAAAAACMA/db5mR8RGXw8/s1600-h/DSCF0018.JPG" target="_blank"><img style="border-width:0px; float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand; width:80px; height:60px;" src="http://3.bp.blogspot.com/_pzC_7PLtN-0/SqVtLM37lKI/AAAAAAAACMA/db5mR8RGXw8/s320/DSCF0018.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5378825369165730978" /></a>
<br clear=left />

This is a fluid template. If you make the browser window narrow, the post column will become narrow. See what happens if you make the post column too narrow to show both pictures side by side - grab the size of the browser window, and move it inward.

>> Top

5 comments:

Floyd said...

Great post and good tutorial on arranging photo's in blogger.

Doobie said...

thank you thank you thank you!

TheBurmeseMom said...

Thanks. You've been a big help to me..a newbie.

Kay said...

what about youtube videos?

Chuck Croll said...

Kay,

If you make a YouTube video small enough, remove the "display=block", and if your browser does not require use of the "float" setting to display an embedded object side by side, then any video should display side by side. I'm not confident that it would be a consistent behaviour, for all browsers, though.

http://blogging.nitecruzr.net/2006/11/including-video-in-your-post.html