垂直滚动条可见但不起作用的CSS

时间:2016-08-08 07:57:47

标签: css css3

滚动条可见但不起作用。以下是显示段落的CSS代码:

CSS:

outer { 
     width: 100%;
     max-height: 400px;
     margin: 60px auto 0;
     overflow-x: hidden;
     overflow-y:auto;
     line-height: 20px;

     p {
         margin: 0 auto;
         padding-right: 20px;
     }
}

HTML:

<div class="outer">
     <p>  long text....  <p>
</div>

3 个答案:

答案 0 :(得分:1)

Plz检查你的css

.outer { width: 100%; max-height: 400px; margin: 120px;overflow-x: hidden;overflow-y:auto; line-height: 20px; }

p { margin: 0 auto;padding-right: 20px;}

答案 1 :(得分:1)

看看

.outer {     width: 100%;
    max-height: 400px;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    line-height: 20px;
    background: #ccc;
 }

p { margin: 0 auto;padding-right: 20px;}
<div class="outer">
	<p>Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:Scrollbar is visible but not working. Following is the code for CSS for display paragraph:</p>
</div>

答案 2 :(得分:0)

此代码在我的本地计算机上正常运行:

.outer {    
    width: 100%;
    max-height: 400px;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    line-height: 20px;
    background: #ccc;
 }

p { margin: 0 auto;padding-right: 20px;}

<div class="outer">
  <p>pls place scroll content here</p>
</div>