search

Home  >  Q&A  >  body text

javascript - Why do I set height: 100%; overflow: hidden; but the content and scroll bar still overflow. Please give me advice?

typechotypecho2801 days ago1029

reply all(6)I'll reply

  • 代言

    代言2017-06-28 09:26:00

    How about changing

    height to an absolute value? And your screenshot overflow-y is auto. Why not use hidden

    reply
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-06-28 09:26:00

    The screenshot is not very clear. Who is it 100% based on?

    reply
    0
  • 某草草

    某草草2017-06-28 09:26:00

    I guess it’s because you used overflow: hidden and float at the same time.

    It is necessary to understand the detailed explanation of CSS BFC and the origin of float and overflow: hidden. We have cleared the floats together in those years.
    I will post some related questions for you. Please understand more and find solutions:
    In CSS Why can overflow:hidden clear the impact of float? What is the principle?

    reply
    0
  • 为情所困

    为情所困2017-06-28 09:26:00

    The outermost p needs to have a fixed height, and ul is the height: 100%;

    reply
    0
  • 代言

    代言2017-06-28 09:26:00

    Is your ulthere is something at the same level? height: 100% will inherit the height of the parent. If ulhas content at the same level, it will hold ul down. It is recommended to wrap a p suitable for the height on the outer layer, and write ulscroll inside the p

    reply
    0
  • ringa_lee

    ringa_lee2017-06-28 09:26:00

    height: 100% height is inherited from the upper layer

    reply
    0
  • Cancelreply