html - 应用位置 : fixed 时 IE8 出现问题

标签 html css internet-explorer

这是我的 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/

相关文章:

java - 如何在Java中捕获html响应?

javascript - 如果从上下文菜单调用,Chrome getSelection 不工作

html - CSS 'bullet' 使用 em 单位的悬挂缩进

css - css中的梯形轮廓

internet-explorer - youtube 播放器上的 CSS3 旋转在 IE FF 上不起作用

javascript - 使用 javascript 构造 HTML 并传递变量(onclick 函数) - 引号/双引号语法问题

css - 带有内部样式表的表格宽度

php - 在 Symfony 2 元素中安装 Bootstrap 主题

css 悬停动画在 ie11 中不起作用。将鼠标悬停在 IE 中不起作用的元素上时的 CSS 过渡

javascript - IE8 中的 google map 意外调用