Jump to content

Distribute text evenly


kurt.santo
 Share

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...