html - 如何替换 CSS 表达式

标签 html css css-expressions

我有一个用于时间表条目的旧 ASP Web 应用程序,其中充满了 CSS 表达式。它们出现在 CSS 文件中:

.ApptPage {
    position            : relative;
    height              : expression(Math.max(document.body.offsetHeight-this.offsetTop-document.body.marginTop,0));
    border              : 0 solid black;
}

在 ASP 中:

<IFRAME SRC="TimeSheetView.asp?<%=sQueryStandard%>" id=frameContent style="border-left:0;position:absolute;top:0;width:expression(Math.max(0,divContent.offsetWidth-20));height:expression(Math.max(0,divContent.offsetHeight-this.offsetTop));border:0px;left:0px;"></IFRAME>

该应用程序在 IE 上运行良好,但经过 10 多年的使用,我们希望为下一个 10 年做好准备,使其与浏览器无关。

这是我第一次在 CSS 中看到表达式,我不知道如何找到一种方法来替换它?有人有什么建议吗?

最佳答案

这些表达式是 IE 特有的,但它们已被弃用和放弃,甚至 IE 也是如此:

引用:http://msdn.microsoft.com/en-us/library/ms537634%28v=vs.85%29.aspx

As of Windows Internet Explorer 8, dynamic properties have been deprecated and are only supported for Web pages displayed in IE5 (Quirks) mode or IE7 Standards mode.

Dynamic properties (also called "CSS expressions") are no longer supported in Internet Explorer 8 and later, in IE8 Standards mode and higher.

您可以使用 JavaScript 或 CSS 或两者的组合来实现这些表达式的作用。

关于html - 如何替换 CSS 表达式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16615756/

相关文章:

html - 使用 CSS 并排对齐 div

css - Alternative For Replacing CSS expression for IE10及以上版本

javascript - !important 规则可以用在 IE 的 CSS 表达式中吗?

html - 无法让图像响应?

jquery - 如何在鼠标悬停时获取 "pop-up"术语引用中的超链接,并将 HTML 术语与 "pop-up"引用内容分开

html - 使用 width % 和 padding-bottom % 时方形 div 的固定大小

css - 如何使用 CSS 过渡淡入和淡出背景图像?

javascript - 如何用javascript替换IE8 css表达式

iphone - iPad 在加载带有音频标签的 div 时模糊页面

html - 如何在 zurb foundation 的侧导航中定位用作图标的 ":before"元素?