kurt.santo Posted December 11, 2007 Share Posted December 11, 2007 When I have text that I want to display four times, each taking 25% of the page width, what would be the best way to achieve this? Tried with </ul>, but did not work. Tables working fine, but as we all know you should not use tables to layout text (there is no meaning in what I am doing;-))... I need to make sure it renders exactly as second text will have to line up with text in div underneath, which has margin-right:26%.Kurt Link to comment Share on other sites More sharing options...
Ingolme Posted December 11, 2007 Share Posted December 11, 2007 WellFirst of all, you should check if the data belongs in a table in the first place, if so, then it's ok to use a table.If not you can try a few things, though I'm a little unsure about them.You could try four floating <div>s:<div class="floater">Content</div><div class="floater">Content</div><div class="floater">Content</div><div class="floater">Content</div>.floater {width: 24%;margin-right: 1%;float: left;}Or absolute positioning within another <div>:<div id="container"><div class="floater" style="left: 0">Content</div><div class="floater" style="left: 25%">Content</div><div class="floater" style="left: 50%">Content</div><div class="floater" style="left: 75%">Content</div></div>#container {width: 100%;position: relative;}.floater {width: 25%;position: absolute;} Link to comment Share on other sites More sharing options...
kurt.santo Posted December 12, 2007 Author Share Posted December 12, 2007 Ingolme,You first version works for me, cheers! Have to get my head around floating, always thought there is only one div you can float to the left and one to the right...Kurt Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.