ghurty Posted July 1, 2009 Share Posted July 1, 2009 How can I have two columns (each row has text and image), but with everything in the same DIV? Thanks Quote Link to comment Share on other sites More sharing options...
haku Posted July 2, 2009 Share Posted July 2, 2009 Here is an example: HTML: <div id="columns"> <p>some text</p> <span><img src="img.jpg" alt="image" /></span> <p>some more text</p><span> <img src="another/img.jpg" alt="another image" /></span> </div> CSS: #columns { width: 1000px; margin: 0 auto; overflow:auto; } #columns p { width:50%; float:left; clear:both; } #columns span { width:50%; float:right; } You'll have to adjust the numbers depending on the size of your image and stuff. But this is a basic outline. Quote Link to comment Share on other sites More sharing options...
arneman Posted July 10, 2009 Share Posted July 10, 2009 Or use a table with 2 columns? Quote Link to comment Share on other sites More sharing options...
haku Posted July 10, 2009 Share Posted July 10, 2009 Columns shouldn't be used for layout purposes. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.