Search code examples
htmlscrolloverflowpre

How to automatically disable and enable scroll for pre tag


I need to implement down and up scroll when height of pre will be became more than X px. My friend behind cell phone says you can, and you need define maximum px of pre tag and when pre overflow, it must be visible, but I don't know css well and I couldn't implement this.

UPDATE:

Indeed U need to if my lines bigger than X line scroll enable and else it's invisible.

Can you put this code?


Solution

  • Use this it will work,

    pre{
    width:100px;/*set appropriate width you want*/
    overflow-y:hidden;
    }
    

    Take a look at this fiddle: http://jsfiddle.net/04qf1shv/