Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
634 views
Welcome To Ask or Share your Answers For Others

1 Answer

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"> 

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...