Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

thumbnail images in a div

Status
Not open for further replies.
Mar 11, 2004
127
GB
Ok, I'm recreating my site, and I have so far found div's the best for what I'm trying to achieve. However, now I want to put up my images. My existing page has the rough layout that I want to keep. But I cannot think if div's would be the best approach, or if I should stick to tables and cells for this sort of page.

Whats your advice people?

Thanks in advance,
Ant
 
Go with divs. This is a perfect example of floating. Floating is actually much better for the job than tables, because it will automatically wrap the contents. So if you ever decide to expand the page or make it more fluid your code will simply adjust whereas with tables you would need to redo the table completely.
 
Why not float the img elements?
No need to wrap them in divs really.

Either give them a class, or better still put them in a surrouding div with an ID.

Foamcow Heavy Industries - Web design and ranting
Target Marketing Communications - Advertising, Direct Marketing and Public Relations
I wonder what possesses people to make those animated gifs. Do you just get up in the morning and think, "You know what web design r
 
ok, see if I got this right. I can put my images in a main div, which would be my content one. To do this I would folat them? If this is right, do you have any examples of the entries?

Thanks for your help guys

Ant
 
Code:
<style type="text/css">
#content {
 ...
}

#content img {
 float: left;
}

.clearer {
 clear: left;
}
</style>

<div id="content>
 <img /><img /><img /><img /><img />
 <div class="clearer"></div>
</div>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top