开发者

Issues with IE8 when applying Position: fixed

Here's my css code:

background-color: White;
border: 2px solid black;
padding: 10px;
position: fixed;
right: 5px;
top: 开发者_运维百科0;
width: 250px;

It works great in Chrome/Firefox/Safari, but I can't get it working in IE8. The position of div box isn't not in the top right corner. Any ideas on how I can solve this problem?

Along with the 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>


Try adding this in the very top of the document above the header.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/tr/xhtml1/DTD/xhtml1-transitional.dtd"> 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜