• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 253
  • Last Modified:

Fixed width div streching with text instead of wrapping

I have a div that I styled the width to 600px.  When I enter a long string of text, instead of wrapping it @ 600px, it streches out.  I was originally trying to make the div stretch to the size of the page, but got the same results (text going off the screen).  A solution for either the fixed width or strech would be great.
0
ibidata
Asked:
ibidata
1 Solution
 
jagadeesh_motamarriCommented:
Hi ibidata,

Can you please paste your code here.


____Jags.
0
 
ibidataAuthor Commented:
Let me know if you need more.

#pageContent{
      width:600px;
      
      }

<td>
                  <!-- BEGIN PAGE CONTENT-->
                  <div id="pageContent">
                        fdasjklafdjklfdjkl;asfdasfdjkl;asfdjkl;asfdjkl;sfdjkl;asfdjkl;asfdjkl;jkljkl
                        ;asfdjkl;jkl;asfdjkl;asdjkfdakl;fja;dlfjl;kafjdadl;kfjal;jfdkl ;jafdfdasjklafdjklfdjkl;asfdasfdjkl
                        ;asfdjkl;asfdjkl;sfdjkl ;asfdjkl;asfdjkl;jkljkl;asfdjkl;jkl;asfdjkl;asdjkfdakl;fja;dlfjl;kaf  
                        jdadl;kfjal;jfdkl;jafdfdasjklafdjklfdjkl;asfdasfdjkl;asfdjkl;asfdjkl;sfdjkl;asfdjkl;asfdjkl;jk
                        ljkl;asfdjkl;jkl;asfdjkl;asdjkfdakl;fja;dlfjl;kafjdadl;kfjal;jfdkl;jafdfdasjklafdjklfdjkl;asfdasf
                        djkl;asfdjkl;asfdjkl;sfdjkl;asfdjkl;asfdjkl;jkljkl;asfdjkl;jkl;asfdjkl;asdjkfdakl;fja;dlfjl;kafjdadl;
                        kfjal;jfdkl;jafdfdasjklafdjklfdjkl;asfdasfdjkl;asfdjkl;asfdjkl;sfdjkl;asfdjkl;asfdjkl;jkljkl;asfdjkl;
                        jkl;asfdjkl;asdjkfdakl;fja;dlfjl;kafjdadl;kfjal;jfdkl;jafdfdasjklafdjklfdjkl;asfdasfdjkl;asfdjkl;asfdj
                        kl;sfdjkl;asfdjkl;asfdjkl;jkljkl;asfdjkl; jkl;asfdjkl;asdjkfdakl;fja;dlfjl;kafjdadl;kfjal;jfdkl;jafdfd
                        asjklafdjklfdjkl;asfdasfdjkl;asfdjkl;asfdjkl;sfdjkl;asfdjkl;asfdjkl;jkljkl;asfdjkl;jkl;asfdjkl;asdjkfda
                        kl;fja;dlfjl;kafjdadl;kfjal;jfdkl;jafd
                  

                  
                  </div>
                  <!-- END PAGE CONTENT-->

            </td>
0
 
GrandSchtroumpfCommented:
> When I enter a long string of text, instead of wrapping it @ 600px, it streches out.
It's called "overflow" and the default is "visible", which shows your overflowing content outside the container's bounderies.
http://www.blooberry.com/indexdot/css/properties/position/overflow.htm

Wrapping is for words.  If you have very long words, then split them into some smaller pieces... you can use the <wbr> element for that (that's not part of the w3 standards, but all browsers support it).

For an IE-only solution, you can use the css "word-wrap: break-word;":
http://www.blooberry.com/indexdot/css/properties/text/wordwrap.htm
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now