开发者

IE8 rendering of local-files is wrong

开发者 https://www.devze.com 2022-12-30 00:27 出处:网络
It appears that IE8 is not rendering properly a local file: Consider this simple webpage: http://sayang.free.fr/ie8render.html (html code below) extracted from a w3c tutorial on opacity.

It appears that IE8 is not rendering properly a local file:

Consider this simple webpage: http://sayang.free.fr/ie8render.html (html code below) extracted from a w3c tutorial on opacity.

Save it locally and display it again: the local file has no opacity!

That's very annoying, especially when one wants to design complex pages on prototypes placed in local files.

Do you have a solution to that ?

<html>
  <head>
    <title>IE8 Local File</title>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <meta http-equiv="pragma" content="no-cache" />
    <meta http-equiv="cache-control" content="no-cache" />
    <meta http-equiv="expires" content="-1" />

    <style type="text/css">
    div.background
      {
      width: 500px;
      height: 250px;
      background: url(http://www.w3schools.com/css/klematis.jpg) repeat;
      border: 2px solid black;
      }
    div.transbox
      {
      width: 400px;
      height: 180px;
      margin: 30px 50px;
      background-color: #ffffff;
      border: 1px solid black;
      /* for IE */
      filter:alpha(opacity=60);
      /* CSS3 standard */
      opacity:0.6;
      }
    div.transbox p
      {
      margin: 30px 40px;
      font-weight: bold;
      color: #000000;
      }
    </style>
  </head>
  <body>
    <h2>Save this file locally and open it to see the difference</h2>
    <div class="background">
      <div class="transbox">
        <p>This is some text that is placed in the transparent box. This is some text that is placed in the transparent box. This is some text that is placed in the transparent box. This is some text that is placed in the transparent box. This is some text that is placed in the transparent box.</p>
      </div>
    </div>
  </body&g开发者_如何学编程t;
</html>


Add something like this just before the <html> (or between <!DOCTYPE...> and <html>):

<!-- saved from url=(0023)http://www.example.com/ -->

If that's there, Internet Explorer acts as if it has fetched the page from a remote web server instead of loaded it directly off disk.

The URL can be pretty much whatever you want, but the number in parentheses must be the length of the URL.

I can't guarantee it will work, but give it a try if you're still interested in this old question :)


If you know that your code works in IE7 you can force IE8 browsers to use IE7 standards by including the following tag inside <head>

 <meta http-equiv="X-UA-Compatible" content="IE=7"> 


I hope this below URL will help you to solve your issue..

http://css.flepstudio.org/en/css3/opacity-transparency.html


Actually it works now: 2 years after, Microsoft must have improved local documents viewing. It now prompts for executing javascript and actually executes it as if the page was remote.

Many thanks to all of you who have spent some time to reply. Cheers

0

精彩评论

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