如何仅在IE上破解CSS内联样式? [英] How to hack css Inline style only on IE?

查看:89
本文介绍了如何仅在IE上破解CSS内联样式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何仅在IE上破解CSS内联样式?

How to hack css Inline style only on IE ?

要仅在所有版本的IE上破解CSS内联样式,我该怎么办?

to hack css Inline style only on IE in all version, How can i do ?

喜欢

<div style = "
               color: #eee;
               border: 1px solid #000;
for ie only // line-height : 32px;     
             "/>

推荐答案

您需要在属性名称之前添加*,并且该名称仅针对IE7,因此您需要将此line-height : 32px;编写为*line-height : 32px;

You need to add * before the property name, and that will target only IE7, so you need to write this line-height : 32px; as *line-height : 32px;

当我意识到您想要针对每个IE进行破解时,您就可以开始了

As I realized you wanted hacks for each IE, so here you go

  • 对于IE6-_
  • 对于IE7-*
  • 对于IE8-\0
  • 对于IE9-\9
  • For IE6 - _
  • For IE7 - *
  • For IE8 - \0
  • For IE9 - \9

仅使用CSS声明IE10的样式

Declare styles for IE10 specifically using CSS Only

@media all and (-ms-high-contrast: none) { 
   /* This won't go inline but can be used at document level*/
   /* Declaration Blocks Goes Here*/
}

您可以在此处中阅读有关如何使用@media查询声明仅IE样式的更多信息

You can read here for more information on how to declare IE only styles using @media queries

我还是建议您使用条件注释,这将使您的生活更加轻松,而不是声明内联样式.

Still I would suggest you to use conditional comments which will make your life much easier instead of declaring inline styles.

这篇关于如何仅在IE上破解CSS内联样式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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