MAKE TEXT IN PARAGHAPGHS IN DIV OVERFLOW INSTEAD OF NEW LINES

jayprakash sharma

Total Post:117

Points:821
Posted by  jayprakash sharma
 1048  View(s)
Ratings:
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! 
  1. AVADHESH PATEL

    Post:604

    Points:4228
    Re: Make text in paraghapghs in div overflow instead of new lines

    Hi Jayprakash!


    try this way, i hope it resolve your problem

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

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!