no tables

5 Replies - 5456 Views - Last Post: 21 January 2007 - 08:16 PM

CSS: align text at a specific point

Posted 21 January 2007 - 12:58 PM

my problem is i am trying to align text like such:

label1: 1 2 3 4
label2_is_longer: 1 2 3 4

such that they line up on the : or even the space between label and links.

They are just within a div, as a header and footer, but there has become more than 1 row on a specific page and thus i want to align them.
(this is not my choice on how to do it, it's a stupid, stupid assignment)

anyway i can't use tables... not that i'd want to, and inline css is not allowed either.

This is what i currently have on my header, the question is if i run this on more than one subheader, is there any way to align on a point that is not based on the side of the browser, but instead on the text itself?

Re: CSS: align text at a specific point

such that they line up on the : or even the space between label and links.

They are just within a div, as a header and footer, but there has become more than 1 row on a specific page and thus i want to align them.
(this is not my choice on how to do it, it's a stupid, stupid assignment)

anyway i can't use tables... not that i'd want to, and inline css is not allowed either.

This is what i currently have on my header, the question is if i run this on more than one subheader, is there any way to align on a point that is not based on the side of the browser, but instead on the text itself?

Re: CSS: align text at a specific point

such that they line up on the : or even the space between label and links.

I think you should clarify which browsers this needs to work in. You can use the correct method that doesn’t work with Internet Explorer for one. It works in Opera, but Firefox doesn’t understand display: inline-block, so the proprietary declaration display: -moz-inline-block needs to be used for that browser.