HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
How to put image - text - image - text all side by side
Post new topic   Reply to topic    HTML Help Forum Index -> MySpace
View previous topic :: View next topic  
Author Message
pivoune



Joined: 18 Jan 2008
Posts: 1

PostPosted: Fri Jan 18, 2008 10:37 am     How to put image - text - image - text all side by side Reply with quote

Hello Smile
I'd like to put horizontally on one line an image then text, then another image and again text. However so far I only managed to put text on the right of an image.


I have the following code withe follwing result:



<a href="/work/15605/book/20882046">
<img style="height: 100px; float:left; vertical-align:text-top; margin-right:10px;" src="http://images.amazon.com/images/P/0575079096.01._SX140_SCLZZZZZZZ_.jpg"/></a><a href="/work/15605/book/20882046"> The Stars My Destination</a>
by <a href="/author/besteralfred"> Alfred Bester</a>
<a href="/catalog_bottom.php?tag=The+Stars+My+Destination&view=pivox"> In my catalog</a>
<a href="http://images.amazon.com/images/P/0575079096.01._SX140_SCLZZZZZZZ_.jpg">Bigger cover</a>

However I'd like the following:
(Same as above but twice and all on one line like below)




thanks a lot for your help Smile
PayneLess Designs



Joined: 28 Feb 2007
Posts: 1408
Location: Biloxi, MS

PostPosted: Sun Jan 27, 2008 12:34 am     Reply with quote

Don't really like using absolute positing, but this will allow you to have some control of where the text is positioned. Just set all the borders from 1px to 0 if you don't want borders.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<title></title>
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="author" content="">
<meta name="generator" content="Matrix Y2K from van IJperen Software Inc. - http://www.crystalfibers.com">
<style type="text/css">
div#left { width: 240px; height: 104px; float:left; text-align: top; margin: 2px; border: 1px solid #700; }
div#text_left { width: 160px; position: absolute; top: 17px; left: 85px; vertical-align: top; border: 1px solid #0f0; }

div#middle { width: 240px; height: 104px; float:left; text-align: top; margin: 2px; border: 1px solid #700; }
div#text_middle { width: 160px; position: absolute; top: 17px; left: 330px; vertical-align: top; border: 1px solid #0f0; }

div#right { width: 240px; height: 104px; float:left; text-align: top; margin: 2px; border: 1px solid #700; }
div#text_right { width: 160px; position: absolute; top: 17px; left: 575px; vertical-align: top; border: 1px solid #0f0; }


img { height: 100px; }
</style>
</head>
<body>
<div id="left">
<a href="/work/15605/book/20882046"><img src="http://images.amazon.com/images/P/0575079096.01._SX140_SCLZZZZZZZ_.jpg" alt=""></a><div id="text_left"><a href="/work/15605/book/20882046"> The Stars My Destination</a><br>by <a href="/author/besteralfred"> Alfred Bester</a><br><a href="/catalog_bottom.php?tag=The+Stars+My+Destination&amp;view=pivox"> In my catalog</a><a href="http://images.amazon.com/images/P/0575079096.01._SX140_SCLZZZZZZZ_.jpg">Bigger cover</a></div></div>

<div id="middle">
<a href="/work/15605/book/20882046"><img src="http://images.amazon.com/images/P/0575079096.01._SX140_SCLZZZZZZZ_.jpg" alt=""></a><div id="text_middle"><a href="/work/15605/book/20882046"> The Stars My Destination</a><br>by <a href="/author/besteralfred"> Alfred Bester</a><br><a href="/catalog_bottom.php?tag=The+Stars+My+Destination&amp;view=pivox"> In my catalog</a><a href="http://images.amazon.com/images/P/0575079096.01._SX140_SCLZZZZZZZ_.jpg">Bigger cover</a></div></div>

<div id="right">
<a href="/work/15605/book/20882046"><img src="http://images.amazon.com/images/P/0575079096.01._SX140_SCLZZZZZZZ_.jpg" alt=""></a><div id="text_right"><a href="/work/15605/book/20882046"> The Stars My Destination</a><br>by <a href="/author/besteralfred"> Alfred Bester</a><br><a href="/catalog_bottom.php?tag=The+Stars+My+Destination&amp;view=pivox"> In my catalog</a><a href="http://images.amazon.com/images/P/0575079096.01._SX140_SCLZZZZZZZ_.jpg">Bigger cover</a></div></div>

</body></html>


The div#text_left, div#text_middle and div#text_right styling can be combined into one class if you don't need any styling separate from each other.

Hope this helps.
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> MySpace All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial