This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Stylesheets > November 2004 > Text align query
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| KiwiBrian 2004-11-27, 7:16 pm |
| Is there a generic method of ensuring, using css, that the last word in a
random
amount of left-aligned text within a table cell, will be right aligned on
the same line as the immediately preceding text?
My attempts to use span and float caused it to appear lower then its
preceding text on that line.
Brian Tozer
| |
| vatore 2004-11-27, 11:15 pm |
|
"KiwiBrian" <briantoz@ihug.co.nz> wrote
> Is there a generic method of ensuring, using css, that the last word in a
> random
> amount of left-aligned text within a table cell, will be right aligned on
> the same line as the immediately preceding text?
> My attempts to use span and float caused it to appear lower then its
> preceding text on that line.
>
I don't see URL here nor even a sample code...
But if you put the last word into a <span> and made it display: block; it is
correct that it moved to new line, because float on inline elements changes
them to display: block;
I think you can do it this way:
td { line-height: 1.2em; }
..lastword { float: right; margin-top: -1.2em; }
<td>
and here is the text contained in containing element (above style will
affect all table cells you have in your document giving them the line-height
of 1.2em;) in which the last word is in <span class="lastword">here</span>
</td>
- the word "here" is in the last line (visually) and right aligned.
i hope it works for you (quickly tested worked)
--
pawel[dot]knapik[at]gmail[dot]com
www.csslayouts.net //version beta
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|