【发布时间】:2011-09-26 23:12:26
【问题描述】:
我有以下 HTML,其中向 CSS 类添加了 DHTML 行为。当代码按以下方式编写时,Internet Explorer(兼容模式下的版本 8)也会读取 @media 打印,而不是仅使用顶部样式。
<!--[if IE]>
<style>
.roundCorners {
border: 1px solid #b4b4b4;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
background: #fff;
behavior: url(/css/border-radius.htc);
}
@media print {
.roundCorners {
border: 5px solid #b4b4b4;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
background: #fff;
behavior: url(/css/border-radius_remove.htc);
}
}
</style>
<![endif]-->
【问题讨论】:
-
它是应用所有属性还是只应用边界半径?尽管在媒体查询中,但可能始终执行该行为
标签: css dhtml html-components