::before and ::after position absolute acting like position fixed

后端 未结 2 1713
悲哀的现实
悲哀的现实 2020-12-12 02:57

So I am trying to position my pseudo element with position absolute, but instead, it is acting like its parent is something else.




        
2条回答
  •  自闭症患者
    2020-12-12 03:25

    An element with position: absolute; is positioned relative to the nearest positioned ancestor (instead of positioned relative to the viewport

    w3schools example here

    My Example here

      p{
           position:relative;
      }
    

提交回复
热议问题