Align div with fixed position on the right side

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

    Here's the real solution (with other cool CSS3 stuff):

    #fixed-square {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 9500;
    cursor: pointer;
    width: 24px;
    padding: 18px 18px 14px;
    opacity: 0.618;
    -webkit-transform: rotate(-90deg);
    -moz-transform: rotate(-90deg);
    -ms-transform: rotate(-90deg);
    transform: rotate(-90deg);
    -webkit-transition: all 0.145s ease-out;
    -moz-transition: all 0.145s ease-out;
    -ms-transition: all 0.145s ease-out;
    transition: all 0.145s ease-out;
    }
    

    Note the top:0 and right:0. That's what did it for me.

提交回复
热议问题