Using CSS Expressions are good or bad?

人走茶凉 提交于 2019-12-24 08:46:54

问题


I need some clarifiction on applying expressions in css. Some are suggesting don't go for using css expressions. Please clarify my doubt. thanks


回答1:


You should not use CSS expressions since they are constantly evaluated on many user interactions across the web page.

Also, Microsoft as deprecated this feature due to this type of complications since IE 8.

Please see the following articles:

From an article published by Steve Souders at YDN

High Performance Web Sites: Rule 7 – Avoid CSS Expressions

The problem with expressions is that they are evaluated more frequently than most people expect. Not only are they evaluated when the page is rendered and resized, but also when the page is scrolled and even when the user moves the mouse over the page.


From the MSDN:

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...

Important

Dynamic properties (also called "CSS expressions") are no longer supported in Internet Explorer 8 and later, in IE8 Standards mode and higher. This decision was made for standards compliance, browser performance, and security reasons


You can see a simple test made to CSS expressions performance here!




回答2:


http://msdn.microsoft.com/en-us/library/ms537634(v=vs.85).aspx

I think this should be enough to answer. I wouldn't recommend to use them.



来源:https://stackoverflow.com/questions/10909846/using-css-expressions-are-good-or-bad

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!