Align div with fixed position on the right side

后端 未结 8 1340
名媛妹妹
名媛妹妹 2021-02-02 08:08

I want to show a div which is always visible even as the user scrolls the page. I have used the CSS position: fixed; for that.

Now I also want

8条回答
  •  说谎
    说谎 (楼主)
    2021-02-02 08:30

    With position fixed, you need to provide values to set where the div will be placed, since it's a fixed position.

    Something like....

    .test
    {
       position:fixed;
       left:100px;
       top:150px;
    }
    

    Fixed - Generates an absolutely positioned element, positioned relative to the browser window. The element's position is specified with the "left", "top", "right", and "bottom" properties

    More on position here.

提交回复
热议问题