| | |
Controlling the max text length
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Feb 2007
Posts: 72
Reputation:
Solved Threads: 0
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!
•
•
Join Date: Feb 2008
Posts: 6
Reputation:
Solved Threads: 1
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
http://www.w3schools.com/jsref/jsref_slice_string.asp
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
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
------------------------------------------------------------
STONEWALL+ | The Digital Marketing Agency
![]() |
Similar Threads
- Threads and MediaPlayer component problem (Pascal and Delphi)
Other Threads in the HTML and CSS Forum
- Previous Thread: newbie needs code help for form
- Next Thread: IFrame
Views: 2334 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for HTML and CSS
2002 appointments asp background backgroundcolor beta browser bug calendar cart center cgi code codeinjection corporateidentity create css deleted design development displayimageinsteadofflash dreamweaver drupal emailmarketing epilepsy explorer firefox flash font fonts form format free frontpage google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft missing mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization perl pnginie6 positioning problem scroll seo shopping studio swf swf. templates textcolor theme timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7 wordpress xml xsl





