Overflow-x: hidden also hides vertical content too

后端 未结 2 762
一整个雨季
一整个雨季 2021-01-07 16:47

I have a DIV measuring 400px wide, containing two DIVs side-by-side, each with width of 400px and height of 600px. The width of both DIVs is fixed, however the height can va

2条回答
  •  盖世英雄少女心
    2021-01-07 17:16

    I think you need this

    #schools-container {
        width: 400px; /* Set the width of the visible portion of content here */
        background-color: fuchsia;
        position: relative;
        overflow-x: hidden;
        overflow-y:auto;
        height:600px;
    }
    

    You need to define height of main div as well.

提交回复
热议问题