By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,676 Members | 1,773 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,676 IT Pros & Developers. It's quick & easy.

Positioning a long line by a short spanned section

P: n/a
G'day everyone

Please tell me the following is possible using CSS positioning (it'll
make my day). I want to position a long line of text on the screen so
that a certain portion of it is in the middle of the screen. This
would be for a concordancer and we want to use HTML for the output.

I was initially thinking of doing this:

This is the <span style="position:center">house</spanthat Jack
built.

But then "This is the that Jack built." is against the left margin
and only "house" is in the centre of the screen.

What I want is that "house" is in the centre of the screen, but the
rest of the text must hug it so that it displays the entire sentence
as a normal sentence (and the user must be able to select and copy it
as a normal sentence). If the sentence is too long on the left or the
right, it can go off-screen... that's okay.

Ultimately, this method will be used to display a long list of
sentences with the same words in the middle in a different colour, so
that users can easily see the words in context to determine how they
are used.

Please note that my CSS skills are very basic.

Any replies are appreciated.

Thanks
Samuel (aka voetleuce aka leuce)
Jan 11 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.