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

Auto-Ident any Wrapping Lines

P: 1
In poetry, it's commonly accepted that if a line wraps, that line should be idented.

For example, if we had a line:

"The quick brown fox jumps over the lazy dog"

but didn't have enough 'width' for that many characters, the appropriate way to write the text on two lines is:


The quick brown fox jumps over
......the lazy dog


* periods = ident

I'm trying to specify for a block of text (a poem, containing lines of different widths) that any wrapping lines that don't fit in my iframe automatically ident.

For example, this poem:

The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog


would automatically appear in a constrained width field as:

The quick brown fox jumps over
......the lazy dog
The quick brown fox jumps over
......the lazy dog
The quick brown fox jumps over
......the lazy dog
The quick brown fox jumps over
......the lazy dog
The quick brown fox jumps over
......the lazy dog



Any thoughts?

Here's an example of the site I'm trying to use this function on:
http://creativestudios.com

<--- see how the auto-generated poem gets messy when the lines are long
Mar 2 '07 #1
Share this Question
Share on Google+
2 Replies


P: 24
How about...

Expand|Select|Wrap|Line Numbers
  1. <style>
  2.   span.line {text-indent : -2em; display : block;}
  3. </style>
  4.  
  5. <div style="margin : 4em">
  6. <span class="line">
  7.   The quick brown fox jumps over the lazy dog
  8. </span>  
  9. <span class="line">
  10.   The quick brown fox jumps over the lazy dog
  11. </span>
  12. <span class="line">
  13.   The quick brown fox jumps over the lazy dog
  14. </span>
  15. <span class="line">
  16.   The quick brown fox jumps over the lazy dog
  17. </span>
  18. </div>
Mar 2 '07 #2

drhowarddrfine
Expert 5K+
P: 7,435
Very good, Conan. I tried that last night but now realize the 'display:block' was what I was needing to get it to work. However, I'm not sure he's looking to have to go through every line to do that. This is going to be a difficult thing to accomplish with css and I'm not sure it's possible.
Mar 2 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.