CSS position: absolute screen resolution problem

前端 未结 4 1507
暖寄归人
暖寄归人 2020-12-30 07:40

CSS code:

top:45;
left:98;
float:right;
position:absolute;z-index:2;

I have done the above coding for a floating div when I wa

4条回答
  •  余生分开走
    2020-12-30 08:11

    Assuming the element is not contained within another element with a position of relative, the element you are positioning should be in the same position regardless of resolution.

    Make sure you use:

    top: 45px
    left: 98px
    

    You left the pixel declaration off in your code above.

    Also, float:right is not required on the positioned element, as position:absolute will take it out of the normal flow of the document anyway.

提交回复
热议问题