Connecting Tech Pros Worldwide Help | Site Map

Auto-Ident any Wrapping Lines

  #1  
Old March 2nd, 2007, 05:46 AM
Newbie
 
Join Date: Mar 2007
Posts: 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
  #2  
Old March 2nd, 2007, 10:12 AM
Newbie
 
Join Date: Jan 2007
Posts: 24

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Entery Webpage with tables Peter answers 15 November 3rd, 2008 09:25 AM
Problem with VS2008 editor: How to force insert of tab Red answers 8 June 27th, 2008 08:44 PM
Safari and form variables in html page justplain.kzn@gmail.com answers 2 January 10th, 2007 08:45 PM
drop down box not working in FireFox when on DIV tpaulson@nsc-inc.com answers 2 December 18th, 2005 02:15 AM
Prevent html source text from wrapping/breaking on multiple lines? KathyB answers 1 July 20th, 2005 05:27 PM