search

Home  >  Q&A  >  body text

javascript - position fixed; height 100 is set but it is not the width and height of the browser's visible window. Please clarify.

The following css style code is set, but the displayed height is not full screen, as shown in the figure.

.ss_hide{
    position: fixed;
    background: rgba(0,0,0,.2);
    height: 100%;
    width: 100%;
}

天蓬老师天蓬老师2706 days ago717

reply all(4)I'll reply

  • 阿神

    阿神2017-06-30 10:01:31

    Recommended to use in full screen

    top: 0;
    bottom: 0;
    left: 0;
    right: 0;

    reply
    0
  • 欧阳克

    欧阳克2017-06-30 10:01:31

    Check whether the size of your body and html are full screen. Or 100vh high and 100vw wide

    reply
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-06-30 10:01:31

    You must also add top:0;left:0;

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-06-30 10:01:31

    Absolute positioning is out of the document flow, right? Since everything is absolutely positioned top:0;left:0;right:0;bottom:0; just covers the screen

    reply
    0
  • Cancelreply