HTML: How to create a DIV with only vertical scroll-bars for long paragraphs?

前端 未结 10 701
一向
一向 2020-12-07 16:32

I want to show terms and condition note on my website. I dont want to use text field and also dont want to use my whole page. I just want to display my text in selected area

相关标签:
10条回答
  • 2020-12-07 16:35

    to hide the horizontal scrollbars, you can set overflow-x to hidden, like this:

    overflow-x: hidden;
    
    0 讨论(0)
  • 2020-12-07 16:41

    Thank you first

    Use overflow:auto it works for me.

    horizontal scroll bar disappears.

    0 讨论(0)
  • 2020-12-07 16:47

    For any case set overflow-x to hidden and I prefer to set max-height in order to limit the expansion of the height of the div. Your code should looks like this:

    overflow-y: scroll;
    overflow-x: hidden;
    max-height: 450px;
    
    0 讨论(0)
  • 2020-12-07 16:47
    overflow-y : scroll;
    overflow-x : hidden;
    

    height is optional

    0 讨论(0)
  • 2020-12-07 16:47

    I also faced the same issue...try to do this...this worked for me

            .scrollBbar 
            {
            position:fixed;
            top:50px;
            bottom:0;
            left:0;
            width:200px;
            overflow-x:hidden;
            overflow-y:auto;
           }
    
    0 讨论(0)
  • 2020-12-07 16:49

    To show vertical scroll bar in your div you need to add

    height: 100px;   
    overflow-y : scroll;
    

    or

    height: 100px; 
    overflow-y : auto;
    
    0 讨论(0)
提交回复
热议问题