Float a div above page content

后端 未结 6 827
一生所求
一生所求 2020-12-03 00:33

I\'ve implemented a popup box that dynamically displays search options. I want the box to \"float\" above all of the site content. Currently, when the box is displayed it

6条回答
  •  一个人的身影
    2020-12-03 01:07

    You want to use absolute positioning.

    An absolute position element is positioned relative to the first parent element that has a position other than static. If no such element is found, the containing block is html

    For instance :

    .yourDiv{
      position:absolute;
      top: 123px;
    }
    

    To get it to work, the parent needs to be relative (position:relative)

    In your case this should do the trick:

    .suggestionsBox{position:absolute; top:40px;}
    #specific_locations_add{position:relative;}
    

提交回复
热议问题