HTML: Placing Images or Buttons Side by Side

Sometimes images misbehave and fuss about sitting next to each other. If you desire to make your buttons or images nicely sit side by side without conflict then here are two ways to manage them using HTML.  You can apply this to make a side by side sponsor area such as the one on my sidebar. 

GLAboutMeBedtimeBookCover

GLNarrationRotation

<table>
<tr>
<td><replace with your image URL or button code></td>
<td><replace with your image URL or button code></td>
</tr>
</table>
End Result and Actual Code



GLAboutMeBedtimeBookCover GLNarrationRotation


<center><table>
<tr>
<td><a href="http://www.flickr.com/photos/goldenapples/6259169149/" title="GLAboutMeBedtimeBookCover by thefruitofherhands, on Flickr"><img src="http://farm7.staticflickr.com/6045/6259169149_f626f4ca01_m.jpg" width="180" height="240" alt="GLAboutMeBedtimeBookCover"></a></td>
<td><a href="http://www.flickr.com/photos/goldenapples/6259696194/" title="GLNarrationRotation by thefruitofherhands, on Flickr"><img src="http://farm7.staticflickr.com/6115/6259696194_73aac95e75_m.jpg" width="180" height="240" alt="GLNarrationRotation"></a></td>
</tr>
</table></center>

Simply replace your button codes with the red code above. You can repeat the code to make two more images beneath to make a grid effect.    

And Another Way

You will to get the button codes from your image hosting site. Below are examples of the button codes you will start off with.

<a href="http://www.flickr.com/photos/goldenapples/6771776799/" title="goldentree by thefruitofherhands, on Flickr"><img src="http://farm8.staticflickr.com/7174/6771776799_4243a32fd6_t.jpg" width="100" height="100" alt="goldentree"></a>

<a href="http://www.flickr.com/photos/goldenapples/6771776799/" title="goldentree by thefruitofherhands, on Flickr"><img src="http://farm8.staticflickr.com/7174/6771776799_4243a32fd6_t.jpg" width="100" height="100" alt="goldentree"></a>

<a href="http://www.flickr.com/photos/goldenapples/6771776799/" title="goldentree by thefruitofherhands, on Flickr"><img src="http://farm8.staticflickr.com/7174/6771776799_4243a32fd6_t.jpg" width="100" height="100" alt="goldentree"></a>

<a href="http://www.flickr.com/photos/goldenapples/6771776799/" title="goldentree by thefruitofherhands, on Flickr"><img src="http://farm8.staticflickr.com/7174/6771776799_4243a32fd6_t.jpg" width="100" height="100" alt="goldentree"></a>

Now add <center> to the first button code and then </center> at the end of the second.  If you want a space then add &nbsp; in between the buttons.  Then do the same thing for the next set.

Code will then look like this:

<center><a href="http://www.flickr.com/photos/goldenapples/6771776799/" title="goldentree by thefruitofherhands, on Flickr"><img src="http://farm8.staticflickr.com/7174/6771776799_4243a32fd6_t.jpg" width="100" height="100" alt="goldentree"></a>&nbsp;<a href="http://www.flickr.com/photos/goldenapples/6771776799/" title="goldentree by thefruitofherhands, on Flickr"><img src="http://farm8.staticflickr.com/7174/6771776799_4243a32fd6_t.jpg" width="100" height="100" alt="goldentree"></a></center><center><a href="http://www.flickr.com/photos/goldenapples/6771776799/" title="goldentree by thefruitofherhands, on Flickr"><img src="http://farm8.staticflickr.com/7174/6771776799_4243a32fd6_t.jpg" width="100" height="100" alt="goldentree"></a>&nbsp;<a href="http://www.flickr.com/photos/goldenapples/6771776799/" title="goldentree by thefruitofherhands, on Flickr"><img src="http://farm8.staticflickr.com/7174/6771776799_4243a32fd6_t.jpg" width="100" height="100" alt="goldentree"></a></center>




goldentree goldentree
goldentree goldentree


Note:  Make sure there are no spaces in your code so the pictures like up correctly.

If you have any questions please let me know!



post signature

My Photo
Like My Page Follow Me About Me Moms of Dyslexics
Richele McFarlin, author of Under the Golden Apple Tree, and founder of Moms of Dyslexics, enjoys a good cup of coffee as she demonstrates her ability to wrestle HTML to the ground and write from the heart.

9 comments:

Hidden Treasures said...

Very cool!! I'm really NOT tech savvy!! I can use all the help I can get, and I've often wondered how people did this exact thing!! Thanks!!

Susan said...

I love the code tips! I have a question though. How do you put space between 2 side by side images. I tried cellspacing with a table tag, but it added a border around my images and I don't want a border. I set the border to "0" but still couldn't get rid of it. Any ideas?

Richele said...

Hi Susan,

When I first experimented I did so on a blog post...and an border was seen around the images but as soon as I published it was not there. Was that like the Twilight Zone or something? LOL.

All I did to put a space in between my images was use   in between the center tags. So you have your button or image code then ending center tag   beginning center tag for next button or image code. No spaces between the center tags and the   Am I making sense...I think I am confusing myself..lol.

I am basically HTML illiterate and as I go...lol. So, other than that...no idea. :( sorry!

Susan said...

Thanks for the info.

The Humbled Homemaker said...

Richele, you are such a blessing! I've been wanting to learn how to do this for forever! I bookmarked your post and just got back to it...and it worked the first time! Thank you!! :) <3

savant said...

Beautiful, thank you for the help!

Marci said...

Thank you so much for this Richele :) - I was able to put my ads side by side without any complication. You are a great teacher!

antoniokoebble said...

Very Nice. Thank you so much for this, it helped me greatly

by<br> Justin Stortz said...

Thank you!! This worked great on my blog:
http://justinstortz.blogspot.com