How to remove Left property when position: absolute?

前端 未结 3 1342
-上瘾入骨i
-上瘾入骨i 2020-12-23 13:03

I\'m overriding the site CSS to an RTL version when specific language is chosen.

I have an element which has to have absolute positioning. In the LTR version, I do <

3条回答
  •  轮回少年
    2020-12-23 13:36

    left:auto;
    

    This will default the left back to the browser default.


    So if you have your Markup/CSS as:

    .myClass { position:absolute; left:0; }

    When setting RTL, you could change to:

    .myClass { position:absolute; left:0; } .myClass.rtl { left:auto; right:0; }

提交回复
热议问题