Strange behavior of “overflow: auto” on Chrome

后端 未结 2 1343
别跟我提以往
别跟我提以往 2021-01-12 00:22

I\'m developing a site with a blog section. I need this section to have a fixed height. In order to be able to see all the posts in the blog I added an overflow: aut

相关标签:
2条回答
  • 2021-01-12 00:52

    I found the solution to my problem. For some reason, for this to work in Chrome I had to add a position:relative rule to #content:

    #content{
        position: relative;
        height: 200px;
        overflow:visible;
        border 1px solid red;
    }
    
    0 讨论(0)
  • 2021-01-12 01:02

    A possible answer from HTML5 Application Development Fundamentals

    #content{
         height: 200px;
         region-overflow:auto;
         overflow:visible;
         border 1px solid red;
    }
    

    Now this is gearing more towards responsive design. Add -webkit- before overflow might help since it is a chrome issue only. Assuming it is CSS3.

    #content {
        height: 200px;
        overflow: auto;
        -webkit-overflow: auto;
        border: 1px solid red;
    }
    
    0 讨论(0)
提交回复
热议问题