这是我的 CSS 代码:
background-color: White;
border: 2px solid black;
padding: 10px;
position: fixed;
right: 5px;
top: 0;
width: 250px;
它在 Chrome/Firefox/Safari 中运行良好,但我无法在 IE8 中运行。 div框的位置并非不在右上角。关于如何解决这个问题有什么想法吗?
与 HTML 一起
<div style="position:fixed;top:0;right:5px;background-color:White;padding:10px;border:2px black solid;width:250px;">
<div>content here</div>
</div>
最佳答案
尝试将其添加到文档最顶部的标题上方。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/tr/xhtml1/DTD/xhtml1-transitional.dtd">
关于html - 应用位置 : fixed 时 IE8 出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6435867/