Align div with fixed position on the right side

后端 未结 8 1348
名媛妹妹
名媛妹妹 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:19

    Trying to do the same thing. If you want it to be aligned on the right side then set the value of right to 0. In case you need some padding from the right, set the value to the size of the padding you need.

    Example:

    .test {
      position: fixed;
      right: 20px; /* Padding from the right side */
    }
    

提交回复
热议问题