Just to make it easier to explain, i quickly made a picture:
So any ideas on how to create that in HTML/CSS?
Just to make it easier to explain, i quickly made a picture:
So any ideas on how to create that in HTML/CSS?
Use the "float: left" property in CSS for each element. Put all the image text inside a containing div and right before the end of the div, addOverall code:HTML Code:<div style="clear: both;"> </div>
HTML Code:<div id="container"> <img style="float: left;" ... /> <div style="float:left; max-width: ??;" ...>Blah Blah Blah Blah Blah Blah</div> <img style="float: left;" ... /> <div style="float:left; max-width: ??;" ...>Blah Blah Blah Blah Blah Blah</div> <div style="clear: both;"> </div> </div>
Last edited by xav0989; 12-12-2009 at 10:08 AM.
█ Xavier L | Community Public Relations Manager (Free Hosting Support)
█ Yes, my position is too cool to even exist!
█ How am I helping? Rate this post by clicking theicon below! (this is even better than "liking" a post)
█ Terms of Service | Acceptable Use Policy | x10Hosting Wiki
What behavior do you want if there isn't enough horizontal space for all the items?
To add a little to xav0989's answer, use classes, rather than inline styling, to associate a style to the elements. Make the names descriptive of what the elements are, rather than how they're styled (e.g. don't use the class "left").
Style:
Structure:Code:ul.profiles, ul.profiles li { margin: 0; padding: 0; list-style-type: none; overflow: auto; } .profiles li, .profiles li img, .profiles li .blurb { float: left; } .profiles li .blurb { max-width: ...; }
If you want the text to flow underneath the pictures, get rid of the .blurb elements.HTML Code:<ul class='profiles'> <li><img src="http://forums.x10hosting.com/programming-help/programming-help/..." /><div class="blurb">Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</div></li> <li><img src="http://forums.x10hosting.com/programming-help/programming-help/..." /><div class="blurb">Donec fermentum orci nec felis.</div></li> <li><img src="http://forums.x10hosting.com/programming-help/programming-help/..." /><div class="blurb">Sed sollicitudin diam id sapien.</div></li> </ul>
Last edited by misson; 12-12-2009 at 04:52 PM.
Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.Misson, not Mission.
Thank you so much!![]()