nfh
04-29-2011, 01:12 AM
Hi,
I'm trying to create a layout that mixes text with images, but I'm having some trouble aligning it all with CSS.
Basically I have this:
<div id="container">
<div id="banners">
<p>Sponsors:</p>
<div id="sponsor-list">
<div id="sponsor-1">
<img src="sponsor1.jpg" />
</div>
<div id="sponsor-2">
<img src="sponsor2.jpg" />
</div>
<div id="sponsor-3">
<img src="sponsor3.jpg" />
</div>
</div>
</div>
<div id="copyright">
<p>Copyright (c) ... </p>
</div>
</div>
I tried to style everything inside banners with float left, and it worked for the content of the banners div. The problem is that the banners div assumes the whole width of the div where it is at and the copyright div is placed below it.
If I style banners with float left as well, its width is as much as the largest image and everything inside that div is placed vertically (one item per row).
What do I have to do in order to have everything shown in a single row?
I'm trying to create a layout that mixes text with images, but I'm having some trouble aligning it all with CSS.
Basically I have this:
<div id="container">
<div id="banners">
<p>Sponsors:</p>
<div id="sponsor-list">
<div id="sponsor-1">
<img src="sponsor1.jpg" />
</div>
<div id="sponsor-2">
<img src="sponsor2.jpg" />
</div>
<div id="sponsor-3">
<img src="sponsor3.jpg" />
</div>
</div>
</div>
<div id="copyright">
<p>Copyright (c) ... </p>
</div>
</div>
I tried to style everything inside banners with float left, and it worked for the content of the banners div. The problem is that the banners div assumes the whole width of the div where it is at and the copyright div is placed below it.
If I style banners with float left as well, its width is as much as the largest image and everything inside that div is placed vertically (one item per row).
What do I have to do in order to have everything shown in a single row?