当我在标签 html 中插入绝对位置时不能绝对位置

cannot absolute position when i insert position absolute in tag html

当我在 div 上插入绝对位置时,但位置不能绝对。

<div style="position: absolute;">
  <a class="bg-yellow fg-black bd-amber" style="padding: 5px; font-size: 12px; border-style: solid; border-width: 2px;" ng-show="alert">
    alert
  </a>
</div>
我想在滑动的时候,内容跟随

div 是绝对位置,您需要提供 属性 和值:

你可以看到下面给出的例子:

http://www.w3schools.com/cssref/tryit.asp?filename=trycss_position_absolute

而且你想要滑行你需要拿position:fixed

http://www.w3schools.com/cssref/playit.asp?filename=playcss_position&preval=fixed