No padding when using overflow: auto

后端 未结 10 2094
天涯浪人
天涯浪人 2020-12-13 23:33

I can\'t get padding-bottom to work when I use overflow-y: auto on a box.

HTML:

10条回答
  •  悲&欢浪女
    2020-12-13 23:52

    I think @-moz-document url-prefix() is what you need.

    #container {
        padding: 3em;
        overflow-x: hidden;
        overflow-y: auto;
        width: 300px;
        height: 300px;
        background: red;
    }
    
    #some_info {
        height: 900px;
        background: #000;
    }
    
    @-moz-document url-prefix() {
      #container > :last-child {
        margin-bottom: 3em;
      }
    }

提交回复
热议问题