The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Can any one suggest the CSS/Script for thsi problem
venkat_walking
post Aug 10 2009, 03:27 PM
Post #1


Member
***

Group: Members
Posts: 30
Joined: 22-May 09
Member No.: 8,678



Hello Friends,

Say, I am having a <DIV > of Width=100 and Height 100.

Now I want to insert some text (words ranging from 4 char - 8 char) in to that <DIV> as innerHTML , words would be separated by a SPACE.

Total characters in a DIV innerHTML would range from 0-80;

The point and need is that, The word i.e the contents should get
* wrapped , automatically
* Resized autimatically to fit in the div. No matter how small it goes. (But It would have a max size limit).

I know java script will come in the play.


Any suggestion would be very helpful

Thanks,

Venkat



User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Aug 12 2009, 08:46 AM
Post #2


.
********

Group: WDG Moderators
Posts: 9,653
Joined: 10-August 06
Member No.: 7



Maybe you could check if the DIV's scrollHeight is larger than its clientHeight (that should happen when a scrollbar is created in a DIV styled with 'overflow: auto'), which means the text must be made smaller, but it sounds complicated and bug-prone.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
venkat_walking
post Aug 13 2009, 05:10 AM
Post #3


Member
***

Group: Members
Posts: 30
Joined: 22-May 09
Member No.: 8,678



QUOTE(Christian J @ Aug 12 2009, 08:46 AM) *

Maybe you could check if the DIV's scrollHeight is larger than its clientHeight (that should happen when a scrollbar is created in a DIV styled with 'overflow: auto'), which means the text must be made smaller, but it sounds complicated and bug-prone.


Ok i will check it out and get it to you

Thanks

Venkat
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 18th April 2024 - 11:08 PM