HighDots Forums  

Text align query

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Text align query in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
KiwiBrian
 
Posts: n/a

Default Text align query - 11-27-2004 , 04:57 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



Reply With Quote
  #2  
Old   
vatore
 
Posts: n/a

Default Re: Text align query - 11-27-2004 , 05:39 PM







"KiwiBrian" <briantoz (AT) ihug (DOT) co.nz> wrote
Quote:
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




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.