Controlling the max text length

Thread Solved

Join Date: Feb 2007
Posts: 72
Reputation: adaykin is an unknown quantity at this point 
Solved Threads: 0
adaykin adaykin is offline Offline
Junior Poster in Training

Controlling the max text length

 
0
  #1
Jun 23rd, 2008
Hello, I am trying to control the max length that the text appears, before it goes to the next line in a div. So I want the div to be say 100, but I want the text to only reach 50 before it wraps to the next line. Is there a way I can do this?
My Website <-- check out my site!
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 6
Reputation: gpm1982 is an unknown quantity at this point 
Solved Threads: 1
gpm1982 gpm1982 is offline Offline
Newbie Poster

Re: Controlling the max text length

 
1
  #2
Jun 24th, 2008
It's possible using JavaScript. Use the slice() function to do it. More on slice() function at
http://www.w3schools.com/jsref/jsref_slice_string.asp
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 72
Reputation: adaykin is an unknown quantity at this point 
Solved Threads: 0
adaykin adaykin is offline Offline
Junior Poster in Training

Re: Controlling the max text length

 
0
  #3
Jun 24th, 2008
thx that got it working for me!
My Website <-- check out my site!
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 245
Reputation: macneato is an unknown quantity at this point 
Solved Threads: 21
macneato's Avatar
macneato macneato is offline Offline
Posting Whiz in Training

Re: Controlling the max text length

 
0
  #4
Jun 24th, 2008
Or you could just use padding (which can be added directly to your div id)

So if your div is 100px long and you would like it to start a new line at 50px you would add

padding-right:50px
If this reply solved your problem, please add to my reputation and don't forget to mark this thread as solved.
------------------------------------------------------------
STONEWALL+ | The Digital Marketing Agency
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the HTML and CSS Forum


Views: 2334 | Replies: 3
Thread Tools Search this Thread



Tag cloud for HTML and CSS
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC