Internet Explorer无法加载css文件 [英] Internet Explorer fails to load css files

查看:118
本文介绍了Internet Explorer无法加载css文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

情况:



我有一个PHP书面页面,其中将包含一个css通过

 < style type =text / css> @import url(/css/my.css);< / style> 

然后(根据需要)加载一个javascript文件,打开一个新的窗口将使用css声明。



此选项适用于所有浏览器(Internet Explorer(7-9)除外)。



问题:



根据IE开发工具(F12),css文件被加载,我可以看到在这个文件



解决方案:

em>



取消选择(并且重新选择它们,即使没有必要)在IE的CSS标签中给定CSS文件的一些规则






$ b

其他资讯: $ b

我没有超过4095(甚至不计数所有的CSS文件alltogether)选择器(实际上我有小于2.5k),我只加载少于31(正好7)不同的CSS文件。 / p>

根据要求

  div class =navigate> 
< div class =nav-slider>
< div class =nav-slider-left>
< span role =buttonclass =nav-link nav-page-back>& lt;< / span>

< div class =page-number>
< span> 1/1< / span>
< / div>< span role =buttonclass =nav-link nav-page-next>& gt;< / span>< span role =
buttonclass =nav-link nav-now>& acirc;& mdash;< / span>< span role =buttonclass =
nav-link nav-prev- >& lt;& lt;<< / span>< span role =buttonclass =
nav-link nav-prev-day>& lt;< ;
< / div>

< div class =nav-slider-content>
< div class =nav-slider-bar>
< a class =nav-slider-button>< / a>
< / div>
< / div>

< div class =nav-slider-right>
< span role =buttonclass =nav-link nav-next-day>& gt;< / span>< span role =button
class = nav-link nav-next-week>& gt;< / span>< span role =buttonclass =
nav-link nav-zoomIn> ; / span>< span role =buttonclass =
nav-link nav-zoomOut> - < / span>
< / div>
< / div>



代码到相关部分[ExtJS正在围绕给定代码创建大量结构)



CSS声明在这里

解决方案

我不确定,但它可能是一个缓存问题因为您的样式被解释为inline-css,并且当您打开一个新窗口时不会被保存。您尝试使用:

 < link href =yourcssfile.csstypetext / css =stylesheet />。 




UPDATE:
这似乎是一个错误。我发现你的问题在这篇文章(point5)。


http://www.webcredible.co.uk/user-friendly-resources/css/internet-explorer.shtml


Situation:

I have a PHP written page, wich will include a css via

<style type="text/css">@import url(/css/my.css);</style>

Afterwards (and on demand) a javascript file is loaded, that opens a new "Window" where the css declarations would be used.

This works in all Browsers except Internet Explorer (7-9).

Problem:

According to the IE Developer Tools (F12) the css file is loaded and I can see all declarations made within this file (they are correct), but when the new window is displayed, the css declarations do not seem to be in effect.

"Solution":

Deselecting (and reselecting them, even if it's not necessary) some of the rules of the given CSS File in the CSS-Tab of the IE Developer Tools make the page "render" correctly.

Question:

Where does this behaviour come from, and how do i get rid of this?

Additional Information:

I do not have more than 4095 (not even counting all in all CSS Files alltogether) selectors (in fact I have less than 2.5k) and I only load less than 31 (exactly 7) different CSS Files.

As requested:

<div class="navigate">
<div class="nav-slider">
  <div class="nav-slider-left">
    <span role="button" class="nav-link nav-page-back">&lt;</span>

    <div class="page-number">
      <span>1 of 1</span>
    </div><span role="button" class="nav-link nav-page-next">&gt;</span><span role=
    "button" class="nav-link nav-now">&acirc;&mdash;</span><span role="button" class=
    "nav-link nav-prev-week">&lt;&lt;</span><span role="button" class=
    "nav-link nav-prev-day">&lt;</span>
  </div>

  <div class="nav-slider-content">
    <div class="nav-slider-bar">
      <a class="nav-slider-button"></a>
    </div>
  </div>

  <div class="nav-slider-right">
    <span role="button" class="nav-link nav-next-day">&gt;</span><span role="button"
    class="nav-link nav-next-week">&gt;&gt;</span><span role="button" class=
    "nav-link nav-zoomIn">+</span><span role="button" class=
    "nav-link nav-zoomOut">-</span>
  </div>
</div>

(i have reduced the HTML Code to the relevant part [ExtJS is creating a massive amount of structure around the given code)

CSS Declarations are here

解决方案

I'm not sure but it might be a caching problem since your styles are interpreted as inline-css and won't be saved when you open a new window. Did you try to use:

<link href="yourcssfile.css" type"text/css" rel="stylesheet"/> 

UPDATE: It seems to be a bug. I found your problem in this article (point5). Solution is in there aswell.

http://www.webcredible.co.uk/user-friendly-resources/css/internet-explorer.shtml

这篇关于Internet Explorer无法加载css文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆