Connecting Tech Pros Worldwide Help | Site Map

Auto-Ident any Wrapping Lines

 
LinkBack Thread Tools Search this Thread
  #1  
Old March 2nd, 2007, 04:46 AM
Newbie
 
Join Date: Mar 2007
Posts: 1
Default Auto-Ident any Wrapping Lines

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
Reply
  #2  
Old March 2nd, 2007, 09:12 AM
Newbie
 
Join Date: Jan 2007
Posts: 24
Default

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>
Reply
  #3  
Old March 2nd, 2007, 03:37 PM
drhowarddrfine's Avatar
Expert
 
Join Date: Sep 2006
Posts: 5,276
Default

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
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.