简体   繁体   English

CSS正确的支持在IE上不起作用

[英]CSS right prop not working on IE

I have this button: 我有这个按钮:

 .up-btn-svg { height: 40px; position: expression(fixed); bottom: 2%; right: 2%; -webkit-transition: all 200ms ease-in; -moz-transition: all 200ms ease-in; -o-transition: all 200ms ease-in; transition: all 200ms ease-in; } .btn{ background-color: transparent; position: fixed; bottom: 30px; right: 30px; border-radius: 5px; border: 2px solid transparent; } 
 <a href="#" class="btn"> <svg class="up-btn-svg" viewBox="0 0 99.999995 99.999995"> <g transform="translate(0,-99.999988)"> <path d="M 20 0 C 8.9199935 0 0 8.9199935 0 20 L 0 80 C 0 91.080005 8.9199935 100 20 100 L 80 100 C 91.080005 100 100 91.080005 100 80 L 100 20 C 100 8.9199935 91.080005 0 80 0 L 20 0 z M 50.091797 12.806641 L 76.353516 38.027344 C 77.205446 38.870954 76.914751 40.605074 76.275391 40.746094 L 64.447266 40.730469 L 64.433594 71.550781 C 64.251424 73.505371 62.420636 74.659589 60.853516 74.730469 L 39.009766 74.699219 C 38.242966 74.732019 35.896786 73.921469 35.634766 71.605469 L 35.634766 40.736328 L 23.929688 40.736328 C 23.257527 40.515358 22.500917 39.392981 23.929688 37.863281 L 50.091797 12.806641 z M 25.722656 82.671875 L 74.277344 82.671875 C 75.693699 82.671875 76.833984 83.81216 76.833984 85.228516 L 76.833984 87.458984 C 76.833984 88.87534 75.693699 90.015625 74.277344 90.015625 L 25.722656 90.015625 C 24.306301 90.015625 23.166016 88.87534 23.166016 87.458984 L 23.166016 85.228516 C 23.166016 83.81216 24.306301 82.671875 25.722656 82.671875 z " fill="red" transform="translate(0,99.999988)" /> </g> </svg> </a> 

The problem cames up when I open it using IE 11.0, right seems to be not working well. 当我使用IE 11.0打开它时,出现了问题, right似乎无法正常工作。 In this fiddle you will see that position look wrong using IE. 这个小提琴中,您将看到使用IE position错误的position What does "look wrong" mean? “看错了”是什么意思? The button tend to be at the center more than to the right. 该按钮往往位于中心而不是右侧。

Additionally to your height , you will also have to specify a width for your SVG element. 除了height ,您还必须为SVG元素指定width

Plus: I would recommend to not use expressions for they are deprecated since IE8. 加:我建议不要使用自IE8以来已弃用的表达式

 .up-btn-svg { height: 40px; width: 40px; -webkit-transition: all 200ms ease-in; -moz-transition: all 200ms ease-in; -o-transition: all 200ms ease-in; transition: all 200ms ease-in; } .btn { background-color: transparent; position: fixed; bottom: 30px; right: 30px; border-radius: 5px; border: 2px solid transparent; } 
 <a href="#" class="btn"> <svg class="up-btn-svg" viewBox="0 0 99.999995 99.999995"> <g transform="translate(0,-99.999988)"> <path d="M 20 0 C 8.9199935 0 0 8.9199935 0 20 L 0 80 C 0 91.080005 8.9199935 100 20 100 L 80 100 C 91.080005 100 100 91.080005 100 80 L 100 20 C 100 8.9199935 91.080005 0 80 0 L 20 0 z M 50.091797 12.806641 L 76.353516 38.027344 C 77.205446 38.870954 76.914751 40.605074 76.275391 40.746094 L 64.447266 40.730469 L 64.433594 71.550781 C 64.251424 73.505371 62.420636 74.659589 60.853516 74.730469 L 39.009766 74.699219 C 38.242966 74.732019 35.896786 73.921469 35.634766 71.605469 L 35.634766 40.736328 L 23.929688 40.736328 C 23.257527 40.515358 22.500917 39.392981 23.929688 37.863281 L 50.091797 12.806641 z M 25.722656 82.671875 L 74.277344 82.671875 C 75.693699 82.671875 76.833984 83.81216 76.833984 85.228516 L 76.833984 87.458984 C 76.833984 88.87534 75.693699 90.015625 74.277344 90.015625 L 25.722656 90.015625 C 24.306301 90.015625 23.166016 88.87534 23.166016 87.458984 L 23.166016 85.228516 C 23.166016 83.81216 24.306301 82.671875 25.722656 82.671875 z " fill="red" transform="translate(0,99.999988)" /> </g> </svg> </a> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM