472,127 Members | 1,735 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,127 software developers and data experts.

Positioning a long line by a short spanned section

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

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.

Samuel (aka voetleuce aka leuce)
Jan 11 '08 #1
0 1499

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Andrew Jones | last post: by
6 posts views Thread by Stephen Cook | last post: by
6 posts views Thread by I am Sam | last post: by
65 posts views Thread by kyle.tk | last post: by
15 posts views Thread by David Geering | last post: by
21 posts views Thread by Bart C | last post: by
2 posts views Thread by Slick50 | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.