Home > DeveloperSection > Forums > Make text in paraghapghs in div overflow instead of new lines
jayprakash sharma
jayprakash sharma

Total Post:117

Points:821
Posted on    April-03-2013 2:48 AM

 CSS-CSS3 CSS-CSS3 
Ratings:


 1 Reply(s)
 861  View(s)
Rate this:
Hi Expert!

I have several pretty longs lines in a paragraph:

<div style="overflow: auto"> 
    <p> 
        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb cccccccccccccccccccccccccccccccc
    </p> 
    <p> 
        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb cccccccccccccccccccccccccccccccc
    </p> 
</div>
and window width less that width of the paragraph (a's + b's + c's). Currently scroll will appear only if width of any of components (a, b, or c) is more 

that width of the window and over components are carried to the new lines. I want contents of each paragraph appear on the same line with a scroll. How can 

I treat each paragraph as a string, so contents of the paragraph is treated like a single line?

Thanks in advance! 


AVADHESH PATEL

Total Post:604

Points:4228
Posted on    April-03-2013 8:11 AM

Hi Jayprakash!

try this way, i hope it resolve your problem

p {
    white-space: nowrap;
    overflow: auto
}

Don't want to miss updates? Please click the below button!

Follow MindStick