Connecting Tech Pros Worldwide Forums | Help | Site Map

Auto-Ident any Wrapping Lines

Newbie
 
Join Date: Mar 2007
Posts: 1
#1: Mar 2 '07
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

Newbie
 
Join Date: Jan 2007
Posts: 24
#2: Mar 2 '07

re: Auto-Ident any Wrapping Lines


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>
drhowarddrfine's Avatar
Expert
 
Join Date: Sep 2006
Posts: 5,574
#3: Mar 2 '07

re: Auto-Ident any Wrapping Lines


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.
Reply