开发者

PHP calling and displaying CSS in different browser

开发者 https://www.devze.com 2022-12-13 23:29 出处:网络
I\'m having problem with CSS where, when I run on Mozilla Firefox the CSS is doing fine. But when I run inside Internet Explorer, the CSS is not working. When I try to change the code in the CSS file,

I'm having problem with CSS where, when I run on Mozilla Firefox the CSS is doing fine. But when I run inside Internet Explorer, the CSS is not working. When I try to change the code in the CSS file, it works otherwise. Mozilla is OK, but Internet Explorer is not.

I have an idea calling 2 di开发者_Python百科fferent CSS. For example, style_IE.css and style_moz.css. Both CSS files will be called from header.html.

How can I fix this problem?

Is there some code that can distinguish between browsers? Whenever the user is running in Internet Explorer, then style_IE is called if not it otherwise.


You need to use IE conditional statements.

  <link href="style_moz.css" rel="stylesheet" type="text/css" />
  <!--[if IE]> <style type="text/css">@import "style_IE.css";</style> <![endif]-->

The latter will be used when the browser is Internet Explorer; ignored otherwise.

0

精彩评论

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