Jump to content

Distribute text evenly


kurt.santo

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...