[英]Fixed position DIV that works fine in Chrome and Safari but not in IE11
此CSS导致一个Button锚定在我们网站的屏幕底部。 向上或向下滚动时,该按钮将停留在页面底部。 在IE中,它只是将按钮呈现在DIV代码所在的位置,而不是将其浮动并固定在浏览器底部。 Chrome和Safari都在浏览器窗口的右下方显示该按钮。 我浏览了几篇文章并尝试了不同的CSS设置,但似乎无法理解。 任何帮助将不胜感激。 谢谢!
<style type="text/css">
div[id="bottomButton"] {
position: fixed;
bottom: -20px;
right: 45px;
border: none;
z-index: 50;
border-color: transparent;
width: inherit;
}
</style>
您的代码中缺少HTML文档类型。 尝试下面的代码。
<!DOCTYPE html>
<html>
<head>
<script>
</script>
<style type="text/css">
#bottomButton {
position: fixed;
bottom: -20px;
right: 45px;
border: none;
z-index: 50;
border-color: transparent;
width: inherit;
}
</style>
</head>
<body>
<div id="bottomButton">
<button>mybutton</button>
</div>
</body>
</html>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.