Fixed position but relative to container

后端 未结 25 1607
独厮守ぢ
独厮守ぢ 2020-11-21 23:52

I am trying to fix a div so it always sticks to the top of the screen, using:

position: fixed;
top: 0px;
right: 0px;

However,

25条回答
  •  礼貌的吻别
    2020-11-22 00:47

    My project is .NET ASP Core 2 MVC Angular 4 template with Bootstrap 4. Adding "sticky-top" into main app component html (i.e. app.component.html) on the first row worked, as follows:

    Is that the convention or did I oversimplify this?

提交回复
热议问题